|
From: Gavin K. <ga...@ap...> - 2002-10-07 17:06:16
|
As noted in the documentation, you can't currently use JCS caching with = container-managed transactions. The good news is you *will* be able to in the very next release (I am = implementing it tomorrow) :) ----- Original Message -----=20 From: Joost van de Wijgerd=20 To: hib...@li...=20 Sent: Tuesday, October 08, 2002 2:38 AM Subject: [Hibernate] Hibernate 1.1 and JBoss > strange JTA behavior Hi, I'm using hibernate 1.1 final and JBoss-2.4.9-Tomcat-4.0.4 with a = XADatasource. (from jboss). I have configure the SessionFactory to work with my XADataSource and it works = fine. I use factory-level jcs caching but have the same problems without the cache. Please consider = the following debug trace from jboss: <snippet> [18:18:00,752,JTATransaction] Looking for UserTransaction under: = UserTransaction [18:18:00,752,JTATransaction] Obtained UserTransaction [18:18:00,752,JTATransaction] beginning new transaction [18:18:00,752,SessionImpl] updating = jteam.usermanager.hibernate.UserImpl#357 [18:18:00,752,SessionImpl] flushing session [18:18:00,752,SessionImpl] Flushing entities and processing referenced = collections [18:18:00,752,SessionImpl] Updating entity: = jteam.usermanager.hibernate.UserImpl#357 [18:18:00,772,SessionImpl] Processing unreferenced collections [18:18:00,772,SessionImpl] Scheduling collection = removes/(re)creates/updates [18:18:00,772,SessionImpl] Flushed: 0 insertions, 1 updates, 0 = deletions to 1 objects [18:18:00,772,SessionImpl] Flushed: 0 (re)creations, 0 updates, 0 = removals to 0 collections [18:18:00,772,SessionImpl] Executing [18:18:00,772,ReadWriteCache] Invalidating: 357 [18:18:00,772,CompositeCache] get: key =3D 357, localOnly =3D false [18:18:00,772,LRUMemoryCache] getting item for key: 357 [18:18:00,772,LRUMemoryCache] jteam.usermanager.hibernate.UserImpl: = LRUMemoryCache hit for 357 [18:18:00,772,CompositeCache] jteam.usermanager.hibernate.UserImpl - = Memory cache hit [18:18:00,772,CompositeCache] Updating memory cache [18:18:00,772,CompositeCache] No auxilliary cache to update [18:18:00,772,ClassPersister] Updating entity: = jteam.usermanager.hibernate.UserImpl#357 [18:18:00,772,SessionFactoryImpl] prepared statement get: update = UserImpl set admin =3D ?, password =3D ?, email =3D ?, active =3D ?, = username =3D ?, alert =3D ? where id =3D ? [18:18:00,772,SessionFactoryImpl] preparing statement [18:18:00,772,ClassPersister] Dehydrating entity: = jteam.usermanager.hibernate.UserImpl#357 [18:18:00,772,SessionImpl] Adding to batch [18:18:00,772,SessionImpl] Executing Batch: update UserImpl set admin = =3D ?, password =3D ?, email =3D ?, active =3D ?, username =3D ?, alert = =3D ? where id =3D ? (1) [18:18:00,772,SessionFactoryImpl] closing statement [18:18:00,772,SessionImpl] Initializing collection dirty flags [18:18:00,772,JTATransaction] commit [18:18:00,772,SessionImpl] flushing session [18:18:00,772,SessionImpl] Flushing entities and processing referenced = collections [18:18:00,772,SessionImpl] Processing unreferenced collections [18:18:00,772,SessionImpl] Scheduling collection = removes/(re)creates/updates [18:18:00,772,SessionImpl] Flushed: 0 insertions, 0 updates, 0 = deletions to 1 objects [18:18:00,772,SessionImpl] Flushed: 0 (re)creations, 0 updates, 0 = removals to 0 collections [18:18:00,772,SessionImpl] Executing [18:18:00,772,SessionImpl] Initializing collection dirty flags [18:18:00,782,SessionImpl] closing session [18:18:00,782,SessionImpl] disconnecting session [18:18:00,782,XAConnectionFactory] XAConnectionImpl: = org.jboss.pool.jdbc.xa.wrapper.XAConnectionImpl@163f7a1 has no current = tx! </snippet> As you see an update is issued. According to the output, a new = UserTransaction is obtained and begin is called. As you see, commit is called.. but see the last line: there is no current transaction??? = Seems strange to me. I'm using a Oracle8i database on the backend and the seqhilo.long id generator to generate id's.=20 I have tested this code outside of the jboss container with normal = JDBC transactions and it works fine. I'm looking into it, but maybe one of you guys has an idea?=20 I like hibernate a lot by the way! keep up the good work cheers Joost. -- Joost van de Wijgerd JTeam B.V. www.jteam.nl jo...@jt... +31(0)6 24 111 401 "A good developer knows development is more than programming. A great developer knows development is more than development." -- Scott Ambler |