[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - BMP ejbStore + Hibernate/har/JTA ?
HSerg
do-not-reply at jboss.com
Wed Aug 15 07:36:24 EDT 2007
crosspost from http://www.jboss.com/index.html?module=bb&op=viewtopic&t=115524
When I'm trying to save BMP as: public void SampleBean.ejbStore() throws EJBException, RemoteException {
| try {
| Session hsession = myHelper.getCurrentSession();
| Session dynamicSession = hsession.getSession(EntityMode.MAP);
| dynamicSession.update(_objData);
| } catch (NamingException e) {
| e.printStackTrace();
| }
| }
I have a serious issue - SampleBean.ejbStore doesn't save data to DB, and in the same time, Hibernate is sure that all data is stored.
As you can see from stacktrace, Hibernate stores data into internal cache, but doesn't flush this data into DB. IMHO, it happens because the synchronizer isn't created, which in turn happens because another Hibernate synchronizer exists and executes before SampleBean.ejbStore call.
So, is it a software bug or incorrect configuration of my environment?
System Thread [RMI TCP Connection(2)-192.168.x.x] (Suspended (breakpoint at line 1543 in SampleBean))
| SampleBean.ejbStore() line: 1543
| NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
| NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
| DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
| Method.invoke(Object, Object...) line: 585
| BMPPersistenceManager.invokeEjbStore(EntityEnterpriseContext) line: 498
| CachedConnectionInterceptor.invokeEjbStore(EntityEnterpriseContext) line: 294
| EntityContainer.invokeEjbStore(EntityEnterpriseContext) line: 735
| GlobalTxEntityMap$2.invokeEjbStore(Thread, EntityEnterpriseContext) line: 132
| GlobalTxEntityMap$GlobalTxSynchronization.synchronize() line: 281
| GlobalTxEntityMap$GlobalTxSynchronization.beforeCompletion() line: 345
| TransactionImpl.doBeforeCompletion() line: 1491
| TransactionImpl.beforePrepare() line: 1110
| TransactionImpl.commit() line: 324
| TxInterceptorCMT.endTransaction(Invocation, Transaction, Transaction, int) line: 501
| TxInterceptorCMT.runWithTransactions(Invocation) line: 361
| TxInterceptorCMT.invoke(Invocation) line: 181
| LogInterceptor.invoke(Invocation) line: 205
| ProxyFactoryFinderInterceptor.invoke(Invocation) line: 136
| StatefulSessionContainer(SessionContainer).internalInvoke(Invocation) line: 648
| StatefulSessionContainer(Container).invoke(Invocation) line: 954
| GeneratedMethodAccessor87.invoke(Object, Object[]) line: not available
| DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
| Method.invoke(Object, Object...) line: 585
| ReflectedDispatcher.invoke(Invocation) line: 155
| Invocation.dispatch() line: 94
| Invocation.invoke() line: 86
| XMBean(AbstractMBeanInvoker).invoke(String, Object[], String[]) line: 264
| MBeanServerImpl.invoke(ObjectName, String, Object[], String[]) line: 659
| JRMPInvoker$MBeanServerAction.invoke(ObjectName, String, Object[], String[]) line: 819
| JRMPInvoker.invoke(Invocation) line: 420
| NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
| NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
| DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
| Method.invoke(Object, Object...) line: 585
| UnicastServerRef2(UnicastServerRef).dispatch(Remote, RemoteCall) line: 294
| Transport$1.run() line: 153
| AccessController.doPrivileged(PrivilegedExceptionAction<T>, AccessControlContext) line: not available [native method]
| TCPTransport(Transport).serviceCall(RemoteCall) line: 149
| TCPTransport.handleMessages(Connection, boolean) line: 466
| TCPTransport$ConnectionHandler.run() line: 707
| Thread.run() line: 595
org.jboss.tm.TransactionImpl.doBeforeCompletion() line: 1491
|
| this TransactionImpl (id=95)
| cause null
| done false
| gid GlobalId (id=122)
| heuristicCode 4
| lastBranchId 1
| lastResource TransactionImpl$Resource (id=126)
| lockDepth 0
| locked null
| resources ArrayList<E> (id=128)
| resourcesEnded false
| start 1186562997765
| status 0
| sync Synchronization[12] (id=141)
| [0] StatefulSessionInstanceInterceptor$InstanceSynchronization (id=5356)
| [1] CacheSynchronization (id=5349)
| ctx SessionImpl (id=5368)
| hibernateTransaction null
| jdbcContext JDBCContext (id=5370)
| transaction TransactionImpl (id=95)
| [2] JTASessionContext$CleanupSynch (id=5350)
| [3] TransactionSynchronizer (id=5351)
| [4] EntitySynchronizationInterceptor$InstanceSynchronization (id=5352)
| [5] GlobalTxEntityMap$GlobalTxSynchronization (id=94)
| instances ArrayList<E> (id=5384)
| synchronizing true
| this$0 GlobalTxEntityMap (id=5398)
| tx TransactionImpl (id=95)
| [6] EntitySynchronizationInterceptor$InstanceSynchronization (id=5353)
| [7] EntitySynchronizationInterceptor$InstanceSynchronization (id=5354)
| [8] EntitySynchronizationInterceptor$InstanceSynchronization (id=5355)
| [9] null
| [10] null
| [11] null
| syncAllocSize 12
| syncCount 9
| threads HashSet<E> (id=145)
| timeout TimeoutPriorityQueueImpl$TimeoutExtImpl (id=137)
| timeoutPeriod 300000
| trace true
| transactionLocalMap Collections$SynchronizedMap<K,V> (id=150)
| work null
| xid XidImpl (id=152)
| i 5
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074388#4074388
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074388
More information about the jboss-user
mailing list