I thought this was fixed at least in 3.2 and head. Is there any chance you could try one of these?

On Friday, January 24, 2003, at 12:11 PM, Jonathan.O'[EMAIL PROTECTED] wrote:

David,
Apologies for not giving version info. We use JBoss 3.0.5 running on
Windows and Linux. But it used to happen in 3.0.4 as well (I wrote to the
list last November about it).

The whole problem is that the database rollsback the transaction, and the
JBoss server catches an XAException, but neither our entity/session beans
nor our client application (JUnit) code gets to find out about this
rollback. Our client code continues on in its ignorant way, assuming all
was well, and of course, trips up and falls over almost immediately after
that.

Sorry, I haven't read the spec, but TransactionRolledBackException or TransactionRolledBackLocalException sound OK to me. It looks to me as if fixing this will involve a good bit
of rework, to ensure the commit of the session bean transaction happens
while returning from the Session Bean method. As far as I can tell (or
should that be guess), the session bean method is long returned to the
client before the txn is actually committed.
It is committed by the time the method returns.

david

Lastly, I'm off on holidays for a week, so if you don't see further
replies from me, I'm not being rude!
Ciao,
Jonathan O'Connor
Development Manager
XCOM Dublin
Phone: +353 1 872 3305
Mobile: +353 86 824 0736




David Jencks <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
24.01.2003 15:01
Please respond to jboss-user


To: [EMAIL PROTECTED]
cc:
Subject: Re: [JBoss-user] Session Bean (Txn Required) commit error not being sent
back to the client


Which jboss?
What does happen?
Do you know the spec required behavior? I think it should be
TransactionRolledBackException or TransactionRolledBackLocalException,
but I haven't looked in the spec recently.

david jencks

On Friday, January 24, 2003, at 07:22 AM, Jonathan.O'[EMAIL PROTECTED]
wrote:

Yesterday, we got bitten by the same bug that bit us last November.
Here's
what happens:
1. A client app (JUnit tester) calls a method in a session bean (via
remote interface). The method is marked as Transaction required.
1a. A transaction is started automatically by JBoss.
2. The session bean method creates an entity bean. Because we use
Oracle,
we mark a foreign key field as NOT NULL DEFERRABLE INITIALLY DEFERRED.
This means that the NOT NULL constraint is only checked at commit time,
rather than at insert or update time.
3. The ejbCreate and ejbPostCreate of our entity bean don't call
setFKField(), so this field remains NULL.
4. The code returns from the session bean method.
5. JBoss sees that the code has exited the session bean method marked
as
Txn Required, and tries to commit the Txn.
6. Oracle now kicks in, and checks all the deferred constraints.
Naturally
one of them fails, so Oracle returns an exception saying the
transaction
has failed.

Now for the bug:
There is no place in my code where I can catch this
XAException.
Expected Result:
The XAException should be turned into some sort of EJBException
and returned to the caller of the session bean method.

I'd be happy to provide a small test case for this, but it would use
Oracle. I guess it is possible to get this bug using other databases,
but
I think the SQL script would be DB specific.

2003-01-24 11:44:08,275 WARN [org.jboss.tm.TxCapsule] XAException:
tx=XidImpl [FormatId=257, GlobalId=XCOM-IRL-JONATHAN//8, BranchQual=]
errorCode=XA_UNKNOWN(0)
javax.transaction.xa.XAException: could not commit local
txjavax.resource.ResourceException: SQLException
at
org.jboss.resource.connectionmanager.LocalTxConnectionManager$LocalCon n
ectionEventListener.commit(LocalTxConnectionManager.java:567)
at org.jboss.tm.TxCapsule.commitResources(TxCapsule.java:1714)
at org.jboss.tm.TxCapsule.commit(TxCapsule.java:393)
at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:73)
at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercept o
rCMT.java:251)
at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:92 )
at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.j a
va:130)
at
org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
at
org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContain e
r.java:313)
at org.jboss.ejb.Container.invoke(Container.java:712)
at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
at
org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:3 8
2)
at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess o
rImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:46 0
)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport. j
ava:701)
at java.lang.Thread.run(Thread.java:536)
Ciao,
Jonathan O'Connor
Development Manager
XCOM Dublin
Phone: +353 1 872 3305
Mobile: +353 86 824 0736


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user





-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to