This discussion is archived
0 Replies Latest reply: Apr 6, 2012 3:47 AM by 673954 RSS

EJB 3.0 (MDB) CMT does partial Tx commit in hibernate

673954 Newbie
Currently Being Moderated
Seems like CMT (MDB) does partial commit.+

A secnario like this: we are using EJB3.0 combination with Hibernate
1. Some message sent to queue.

2. MDB listner who listen the queue its onMessage method is invoked. See below for MDB configurations.
@TransactionManagement(TransactionManagementType.CONTAINER)
@TransactionAttribute(TransactionAttributeType.REQUIRED)

3. Some Handler is called from MDB say ResponseHandler.

4. We called 2 update operation from this handler.
ResponseHandler#updateTable1() with below set of execution
|__ em.merg(table1Entity);
|__ em.flush()

ResponseHandler#updateTable2() with below set of execution
|__ em.merg(table2Entity);
|__ em.flush()

Problem:+
I can see only one table1 is get updated. Table2 is not updated with latest value though MDB class is container managed...

Hibernate query logs: In logs i can see update operation for both the tables
Hibernate: update table1...
Hibernate: update table2...

PS: We can't see this problem in case we put debug breakpoint on first line of onMessage() method of MDB
class ResponseListner implements MessageListener
{
public void onMessage(final Message message)
{
Logger.info("ResponseListner.onMessage() : Entered"); //breakpoint line (breakpoint is here)
...
..
}
}

Weblogic transaction logs+
####<Apr 4, 2012 4:49:09 PM IST> <Debug> <JTAXA> <inlinapplication001> <applicationServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <api.user1> <> <> <1333538349228> <BEA-000000> <BEA1-0012DE77F7FE1343F773: null: XA.prepare(rm=WLStore_application_cluster_domain2_applicationServerJDBCStore, xar=WLStore_application_cluster_domain2_applicationServerJDBCStore234212480>
####<Apr 4, 2012 4:49:09 PM IST> <Debug> <JTAXA> <inlinapplication001> <applicationServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <api.user1> <> <> <1333538349228> <BEA-000000> <startResourceUse, Number of active requests:1, last alive time:0 ms ago.>
####<Apr 4, 2012 4:49:09 PM IST> <Debug> <JTAXA> <inlinapplication001> <applicationServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <api.user1> <BEA1-0012DE77F7FE1343F773> <> <1333538349233> <BEA-000000> <BEA1-0012DE77F7FE1343F773: null: XA.prepare DONE:ok>
####<Apr 4, 2012 4:49:09 PM IST> <Debug> <JTAXA> <inlinapplication001> <applicationServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <api.user1> <BEA1-0012DE77F7FE1343F773> <> <1333538349233> <BEA-000000> <endResourceUse, Number of active requests:0>
####<Apr 4, 2012 4:49:09 PM IST> <Debug> <JTAJDBC> <inlinapplication001> <applicationServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <api.user1> <BEA1-0012DE77F7FE1343F773> <> <1333538349233> <BEA-000000> <JDBC LLR pool='com.application.ds' xid='BEA1-0012DE77F7FE1343F773' tbl='WL_LLR_applicationSERVER': begin write XA record table=WL_LLR_applicationSERVER recLen=529>
####<Apr 4, 2012 4:49:09 PM IST> <Debug> <JTAJDBC> <inlinapplication001> <applicationServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <api.user1> <BEA1-0012DE77F7FE1343F773> <> <1333538349234> <BEA-000000> <JDBC LLR pool='com.application.ds' xid='BEA1-0012DE77F7FE1343F773' tbl='WL_LLR_applicationSERVER': after write XA record>
####<Apr 4, 2012 4:49:09 PM IST> <Debug> <JTAJDBC> <inlinapplication001> <applicationServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <api.user1> <BEA1-0012DE77F7FE1343F773> <> <1333538349234> <BEA-000000> <JDBC LLR pool='com.application.ds' xid='BEA1-0012DE77F7FE1343F773' tbl='WL_LLR_applicationSERVER': commit one-phase=false>
####<Apr 4, 2012 4:49:09 PM IST> <Debug> <JTAJDBC> <inlinapplication001> <applicationServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <api.user1> <BEA1-0012DE77F7FE1343F773> <> <1333538349239> <BEA-000000> <JDBC LLR pool='com.application.ds' xid='BEA1-0012DE77F7FE1343F773' tbl='WL_LLR_applicationSERVER': commit complete>
####<Apr 4, 2012 4:49:09 PM IST> <Debug> <JTAXA> <inlinapplication001> <applicationServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <api.user1> <> <> <1333538349240> <BEA-000000> <startResourceUse, Number of active requests:1, last alive time:0 ms ago.>
####<Apr 4, 2012 4:49:09 PM IST> <Debug> <JTAXA> <inlinapplication001> <applicationServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <api.user1> <BEA1-0012DE77F7FE1343F773> <> <1333538349243> <BEA-000000> <BEA1-0012DE77F7FE1343F773: null: XA.commit DONE (rm=WLStore_application_cluster_domain2_applicationServerJDBCStore, xar=WLStore_application_cluster_domain2_applicationServerJDBCStore234212480>
####<Apr 4, 2012 4:49:09 PM IST> <Debug> <JTAXA> <inlinapplication001> <applicationServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <api.user1> <BEA1-0012DE77F7FE1343F773> <> <1333538349243> <BEA-000000> <endResourceUse, Number of active requests:0>
####<Apr 4, 2012 4:49:10 PM IST> <Info> <Health> <inlinapplication001> <applicationServer> <weblogic.GCMonitor> <<anonymous>> <> <> <1333538350589> <BEA-310002> <39% of the total memory in the server is free>
####<Apr 4, 2012 4:49:26 PM IST> <Debug> <JTAXA> <inlinapplication001> <applicationServer> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-0014DE77F7FE1343F773> <> <1333538366645> <BEA-000000> <ResourceDescriptor[WLStore_application_cluster_domain2__WLS_applicationServer]: getOrCreate gets rd: name = WLStore_application_cluster_domain2__WLS_applicationServer
resourceType = 2
registered = true
scUrls = applicationServer+10.19.216.10:5003+application_cluster_domain2+t3+
xar = WLStore_application_cluster_domain2__WLS_applicationServer1926833320
healthy = true
lastAliveTimeMillis = 1333538336966
numActiveRequests = 0
>

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points