Details
Description
Using Atomikos transaction manager one will frequently see following stacktrace:
11-08-25 08:49:21,927 [http-7380-Processor21] Error during afterCompletion
java.lang.IllegalStateException: Unexpected state: afterCompletion called with status 5
at org.exolab.castor.jdo.engine.GlobalDatabaseImpl.afterCompletion(GlobalDatabaseImpl.java:219)
at com.atomikos.icatch.jta.Sync2Sync.afterCompletion(Sync2Sync.java:84)
At http://fogbugz.atomikos.com/default.asp?community.6.802.3 it is explained that Atomikos calls afterCompletion() with state unknown for read-only transactions. It also says that this does not comply to J2EE spec.
To prevent the stacktraces in log and influences by the exception thrown we have to handle this situation.
Final patch