Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JBoss 3.0 + Castor Transaction Rollback Exception

 
Arijit Ghosh
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm using container based transaction of Jboss 3.0. We are using the Struts framework and Castor.

When i try to modify an existing object, the first time it works fine. the next time it throws the
exception given below. Again the third time it works,4th time exception and so on..
However if we try to modify different objects there is no problem.

In the Deployment descriptor, ejb-jar.xml, <tran-attribute> under <assembly-descriptor> tag is set to "Required". We also tried using "RequiresNew".



Here is the code -


Thanks in advance
 
Arijit Ghosh
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Everytime a Client Object needs to be modified, modifyClientDetails is called from Action class and the control shifts to Bean. In the method declared in the BEAN, findByPrimaryKey method is called declared in Castor.
Now this provess is executed for each Client object to be modified. Client Object 1 is modified, it works fine. Then Client Object 2 is modified, it works fine. However, if Client Object 1 is now again modified, an error is thrown. However on 3rd try, again it works.
Can't figure out as to why is it working for odd numbers but not for even nos.
 
Arijit Ghosh
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone faced Transaction related exceptions ?
 
Arijit Ghosh
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Transaction is presently being handled by the container. As mentioned in the ejb-jar.xml file, I have set <trans-attribute> Required under <assembly-descriptor>.
Since I am using Castor, I have the following piece of code...

I have set <res-auth> to Container. So everything is supposed to be handled by the JBoss container.
Any pointers ?
 
Arijit Ghosh
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How should the Castor JDO transaction handling be done ? Should it be Application or Container managed since we are using JBoss 3.0 integrated
 
Arijit Ghosh
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could this problem be related to database locking ? Any suggestions ?
 
Arijit Ghosh
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did any one face Undeclared Throwable Exception : Transaction Rollback Exception ?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic