I have a session bean A who accessing two entity beans, (B and C). The session
bean A try to insert new records into 2 tables by jndi look up those
2 entity beans, B and C.
Insert new records into B is successfully, but when insert new records into C I
got exception came out, but JBOSS is not rolling back the records saved by
entity bean B.
I am writing my program in this way:
|
| //session bean method
|
| public void insertNewRecords() throws Exception{
|
| //JNDI Look up to get B home interface and C home interface
| //insert records to B
| BHomeinterface.create(XXXXX);
|
| //insert records to C
| CHomeinterface.create(XXXXXXX, XXXXX);
| }
|
|
Exception came out after I called "CHomeinterface.create(XXXXXXX, XXXXX);".
According to JBOSS document, if I put "
<transaction-type>Container</transaction-type>" in ejb-jar.xml, JBoss is
supposed to handle transaction for me , right?
But why JBoss is not rolling back new records in B? It came out with still
insert new records into B, and C no record insertion.
Am I doing someting wrong on transaction programming? Or I have to handle the
transaction in program? Then what does JBOss do on helping handling
transaction? It seems it does not work even I let JBOSS to handle transaction
for me.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3927807#3927807
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3927807
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user