| Author |
TX datasource issue again.
|
|
| shlomok 2004-01-19, 2:50 pm |
| I am revising my earlier post with more information.
This is an extremely urgent issue.
We are trying to access a CMP and make a direct JDBC connection in the same seesion been. The problem is that WAS tries to open 2 diffrent session (one for CMP and one for straight JDBC) and manage 2 different XASources coming from the same XADataSource u
nder a single 2PC transaction.
According to the JDBC spec it is possible to make it in a single seesion. Our environment is websphere 5.02 with Oracle 9.01 (using XA/Non XA driver )
I think websphere is still trying to use 2 phase commit even I am only using a SINGLE datasource for both operations.
We tried both XA and non-XA Oracle JDBC drivers , When using the XA we got this XAER_RMERR :
[9/3/03 21:23:39:444 IDT] 2fe0858 TraceNLS u No message text associated with key
The.XA.Error.is............:.-3
The.XA.Error.message.is....:.A.resource.manager.error.has.occured.in.the.transaction.branch.
The.Oracle.Error.code.is...:.2051
The.Oracle.Error.message.is:.Internal.XA.Error
in bundle IBMDataStoreAdapterNLS
[9/3/03 21:23:39:434 IDT] 2fe0858 WSRdbXaResour I
The XA Error is : -3
The XA Error message is : A resource manager error has occured in the transaction branch.
The Oracle Error code is : 2051
The Oracle Error message is: Internal XA Error
[9/3/03 21:23:39:444 IDT] 2fe0858 WSRdbXaResour W DSRA0302E: XAException occurred. Error code is: XAER_RMERR. Exception is:
341210 [Servlet.Engine.Transports : 5] DEBUG com.idit.framework.sce.server.session.SCESessionBean - enter: completeCommandTransaction()
[JAAS ERROR]: ERROR: error while accessing EJB resource, exception: CORBA TRANSACTION_ROLLEDBACK 0x0 No; nested exception is:
org.omg.CORBA.TRANSACTION_ROLLEDBACK: javax.transaction.TransactionRolledbackException: minor code: 0 completed: No
[9/3/03 21:23:40:936 IDT] 2fe0858 SystemOut O 342332
And in non-XA driver this is the stack trace we've got :
[Servlet.Engine.Transports : 1] INFO com.idit.framework.backend.manager.CommonJadeSQLManager - JadeSQLPool inited
StatementElement::setMaxReaders::streamN
ame_=Security max set to 3
[9/7/03 17:38:02:866 IDT] fdb1192 SystemOut O original = 615 final = 615 nbDefine = 0
[9/7/03 17:38:03:127 IDT] fdb1192 TransactionIm E WTRN0062E: An illegal attempt to use multiple resources that have only one-phase capability has occurred within a global transaction.
[9/7/03 17:38:04:038 IDT] fdb1192 LocalTransact E J2CA0030E: Method enlist caught java.lang.IllegalStateException
at com.ibm.ejs.jts.jta.TransactionImpl.enlistResource(TransactionImpl.java:567)
at com.ibm.ejs.jts.jta.JTSXA.enlistResource(JTSXA.java:1061)
at com.ibm.ejs.jts.jta.JTSXA.enlistOnePhase(JTSXA.java:1038)
at com.ibm.ejs.j2c.LocalTransactionWrapper.enlist(LocalTransactionWrapper.java:507)
at com.ibm.ejs.j2c.ConnectionEventListener. interactionPending(ConnectionEventListen
er.java:743)
at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl. processInteractionPendingEvent(WSRdbMana
gedConnectionImpl.java:1299)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection. beginTransactionIfNecessary(WSJdbcConnec
tion.java:328)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.createStatement(WSJdbcConnection.java:697)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.createStatement(WSJdbcConnection.java:673)
at com.alphacsp.jadesql.engine.SQLAnalyser.go(SQLAnalyser.java:367)
at com.alphacsp.jadesql.engine.SQLAnalyser.executeQuery(SQLAnalyser.java:447)
at com.idit.framework.security.server.manager.SecuritySQLManager.getContactName(SecuritySQLManager.java:74
| |
| Yang Lei 2004-01-19, 2:50 pm |
| First, about XA/Non XA datasource:
The websphere driver you use requires using XA database driver if theres
need more than 2 connections for a single datasource in one transaction. So
this is the reason when you use none-XA database driver, you got exception:
quote:
> [9/7/03 17:38:03:127 IDT] fdb1192 TransactionIm E WTRN0062E: An illegal
attempt to use multiple resources that have only one-phase capability has
occurred within a global transaction.
The exception you see when using XA database driver seems Oracle internal XA
error, you may need to check with Oracle if that driver support XA and get
information on why 2051 happens.
Second, to share connection between CMP and JDBC on oracle backend:
I will check and get you an answer shortly.Internal.XA.Error
"shlomok" <shlomok@idit.co.il> wrote in message
news:1567752522.1063087988500.JavaMail.wasadmin@swg3ws006...quote:
> I am revising my earlier post with more information.
> This is an extremely urgent issue.
>
> We are trying to access a CMP and make a direct JDBC connection in the
same seesion been. The problem is that WAS tries to open 2 diffrent session
(one for CMP and one for straight JDBC) and manage 2 different XASources
coming from the same XADataSource under a single 2PC transaction.quote:
> According to the JDBC spec it is possible to make it in a single seesion.
Our environment is websphere 5.02 with Oracle 9.01 (using XA/Non XA driver )quote:
>
> I think websphere is still trying to use 2 phase commit even I am only
using a SINGLE datasource for both operations.quote:
>
>
> We tried both XA and non-XA Oracle JDBC drivers , When using the XA we got
this XAER_RMERR :quote:
>
> [9/3/03 21:23:39:444 IDT] 2fe0858 TraceNLS u No message text associated
with keyquote:
> The.XA.Error.is............:.-3
>
The.XA.Error.message.is....:.A.resource.manager.error.has.occured.in.the.tra
nsaction.branch.quote:
> The.Oracle.Error.code.is...:.2051
> The.Oracle.Error.message.is:.Internal.XA.Error
> in bundle IBMDataStoreAdapterNLS
>
> [9/3/03 21:23:39:434 IDT] 2fe0858 WSRdbXaResour I
> The XA Error is : -3
> The XA Error message is : A resource manager error has occured in the
transaction branch.quote:
> The Oracle Error code is : 2051
> The Oracle Error message is: Internal XA Error
>
> [9/3/03 21:23:39:444 IDT] 2fe0858 WSRdbXaResour W DSRA0302E: XAException
occurred. Error code is: XAER_RMERR. Exception is:quote:
> 341210 [Servlet.Engine.Transports : 5] DEBUG
com.idit.framework.sce.server.session.SCESessionBean - enter:
completeCommandTransaction()quote: [colo
r=darkred]
> [JAAS ERROR]: ERROR: error while accessing EJB resource, exception: CORBA[/color]
TRANSACTION_ROLLEDBACK 0x0 No; nested exception is:quote:
> org.omg.CORBA.TRANSACTION_ROLLEDBACK:
javax.transaction.TransactionRolledbackException: minor code: 0 completed:
Noquote:
> [9/3/03 21:23:40:936 IDT] 2fe0858 SystemOut O 342332
>
> And in non-XA driver this is the stack trace we've got :
>
> [Servlet.Engine.Transports : 1] INFO
com.idit.framework.backend.manager.CommonJadeSQLManager - JadeSQLPool
initedquote:
> StatementElement::setMaxReaders::streamN
ame_=Security max set to 3
> [9/7/03 17:38:02:866 IDT] fdb1192 SystemOut O original = 615 final =
615 nbDefine = 0quote:
> [9/7/03 17:38:03:127 IDT] fdb1192 TransactionIm E WTRN0062E: An illegal
attempt to use multiple resources that have only one-phase capability has
occurred within a global transaction.quote:
> [9/7/03 17:38:04:038 IDT] fdb1192 LocalTransact E J2CA0030E: Method
enlist caught java.lang. IllegalStateExceptionquote:
> at
com.ibm.ejs.jts.jta.TransactionImpl.enlistResource(TransactionImpl.java:567)quote:
> at com.ibm.ejs.jts.jta.JTSXA.enlistResource(JTSXA.java:1061)
> at com.ibm.ejs.jts.jta.JTSXA.enlistOnePhase(JTSXA.java:1038)
> at
com.ibm.ejs.j2c.LocalTransactionWrapper.enlist(LocalTransactionWrapper.java:
507)quote:
> at
com.ibm.ejs.j2c.ConnectionEventListener.interactionPending(ConnectionEventLi
stener.java:743)quote:
> at
com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.processInteractionPendin
gEvent(WSRdbManagedConnectionImpl.java:1299)quote:
> at
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.beginTransactionIfNecessary(WSJdb
cConnection.java:328)quote:
> at
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.createStatement(WSJdbcConnection.
java:697)quote:
> at
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.createStatement(WSJdbcConnection.
java:673)quote:
> at com.alphacsp.jadesql.engine.SQLAnalyser.go(SQLAnalyser.java:367)
> at
com.alphacsp.jadesql.engine.SQLAnalyser.executeQuery(SQLAnalyser.java:447)quote:
> at
com.idit.framework.security.server.manager.SecuritySQLManager.getContactName
(SecuritySQLManager.java:74
| |
| Yang Lei 2004-01-19, 2:50 pm |
| You can go to Websphere infoCenter to find detailed information regarding
connection sharing:
http://publib.boulder.ibm.com/infoc...sinfo/index.jsp
It is under Resources/Data access/Accessing data from applications/
Connection management architecture/Unshareable and shareable connections.
"Yang Lei" <yanglei@us.ibm.com> wrote in message
news:bk4tfn$99n8$1@news.boulder.ibm.com...quote:
> First, about XA/Non XA datasource:
>
> The websphere driver you use requires using XA database driver if theres
> need more than 2 connections for a single datasource in one transaction.
Soquote:
> this is the reason when you use none-XA database driver, you got
exception:quote:
>
> attempt to use multiple resources that have only one-phase capability has
> occurred within a global transaction.
>
> The exception you see when using XA database driver seems Oracle internal
XAquote:
> error, you may need to check with Oracle if that driver support XA and get
> information on why 2051 happens.
>
> Second, to share connection between CMP and JDBC on oracle backend:
>
> I will check and get you an answer shortly.Internal.XA.Error
>
>
>
> "shlomok" <shlomok@idit.co.il> wrote in message
> news:1567752522.1063087988500.JavaMail.wasadmin@swg3ws006...
> same seesion been. The problem is that WAS tries to open 2 diffrent
sessionquote:
> (one for CMP and one for straight JDBC) and manage 2 different XASources
> coming from the same XADataSource under a single 2PC transaction.
seesion.quote: [color=darkred]
> Our environment is websphere 5.02 with Oracle 9.01 (using XA/Non XA
driver )quote:
> using a SINGLE datasource for both operations.
got[QUOTE][color=darkred]
> this XAER_RMERR :
> with key
>
The.XA.Error.message.is....:.A.resource.manager.error.has.occured.in.the.traquote:
> nsaction.branch.
> transaction branch.
> occurred. Error code is: XAER_RMERR. Exception is:
> com.idit.framework.sce.server.session.SCESessionBean - enter:
> completeCommandTransaction()
CORBA[QUOTE][color=darkred]
> TRANSACTION_ROLLEDBACK 0x0 No; nested exception is:
> javax.transaction.TransactionRolledbackException: minor code: 0 completed:
> No
> com.idit.framework.backend.manager.CommonJadeSQLManager - JadeSQLPool
> inited
=[QUOTE][color=darkred]
> 615 nbDefine = 0
> attempt to use multiple resources that have only one-phase capability has
> occurred within a global transaction.
> enlist caught java.lang.IllegalStateException
>
com.ibm.ejs.jts.jta.TransactionImpl.enlistResource(TransactionImpl.java:567)quote:
>
com.ibm.ejs.j2c.LocalTransactionWrapper.enlist(LocalTransactionWrapper.java:quote:
> 507)
>
com.ibm.ejs.j2c.ConnectionEventListener. interactionPending(ConnectionEventLi[QUO
TE]
> stener.java:743)
>
com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl. processInteractionPendinquote:
> gEvent(WSRdbManagedConnectionImpl.java:1299)
>
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection. beginTransactionIfNecessary(WSJdbquote:
> cConnection.java:328)
>
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.createStatement(WSJdbcConnection.quote:
> java:697)
>
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.createStatement(WSJdbcConnection.quote:
> java:673)
> com.alphacsp.jadesql.engine.SQLAnalyser.executeQuery(SQLAnalyser.java:447)
>
com.idit.framework.security.server.manager.SecuritySQLManager.getContactNamequote:
> (SecuritySQLManager.java:74
>
>
| |
| dsluis 2004-03-26, 11:01 am |
| Also had a similar problem with the same error messages. Fixed it by
changing the EJB deployment descriptor to refer to the datasource in a
ResourceRef rather than (incorrectly) a resourceEnvRef.
Hope this helps anyone else with the same problem.
Cheers
Dwane
--
posted via MFF : http://www.MainFrameForum.com - USENET Gateway
| |
| jhloney 2004-04-12, 7:42 pm |
| I'm sort of new to ejbs but I'm running into the same problem. where I have a cmp and a session bean that uses jdbc. I see where you created the references in the ejb deployment descriptor, but how would you use those references in the bean code?
Thanks in advance,
John | |
| David Artus 2004-04-13, 4:34 am |
| You use the java:comp/env namespace, your reference in the DD has a name
such as
myjdbc/dsref
and also in the DD you have a default binding of
myjdbc/dsref ====> jdbc/theRealDs
Note that when you deploy your app to WAS you have a chance to overriude
that default binding.
In your code where presviously you would have
context.lookup("jdbc/theRealDs");
you now have
context.lookup("java:comp/env/myjdbc/dsref");
That's it. The websphere infrastructure maps your request for a resoruce
ref to the real thing.
jhloney wrote:
> I'm sort of new to ejbs but I'm running into the same problem. where I
> have a cmp and a session bean that uses jdbc. I see where you created
> the references in the ejb deployment descriptor, but how would you use
> those references in the bean code?
>
> Thanks in advance,
>
> John
>
>
>
> --
> jhloney
> ------------------------------------------------------------------------
> Posted via http://www.webservertalk.com
> ------------------------------------------------------------------------
> View this thread: http://www.webservertalk.com/message52286.html
>
| |
| bhirschm 2006-03-27, 3:22 am |
| Try this property in the WAS DataSource:
"transactionBranchesLooselyCoupled"
true (java.lang.Boolean)
It solved the problem for us.
This property is introduced as a result of Oraclebug 2511780, Oracle Patch for 2511780 must be installed before setting this property to true, failure to do that would cause a program error. Please check the WebSphere readme file for more info . |
|
|
|