This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Session bean transaction in DAO  RSS feed

 
Gennadiy Vasilevskiy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I have the following issue. My stateless session bean facade is running inside the transaction and has to call 2 entity beans and two stored procedures(that are accessed by DAO's) to do the update. THe stored procedures need to see the updates done by the entity beans and if any of the described updates fail, the whole transaction needs to be rolled back. I have no problems with entity bean, but how can I make DAOs to be avare of the transaction that was started before the flow of control got to those DAO. I am using oc4j
Thank you Gennadiy
P.S. Can I use container managed transactions, or the only way for me is to use user managed transactions with the XA datasource?
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use CMT, just make sure the isolation level of your database is set such that you can view uncommitted results...
Kyle
 
Gennadiy Vasilevskiy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kyle Brown:
You can use CMT, just make sure the isolation level of your database is set such that you can view uncommitted results...
Kyle

THank you for reply.
Even if I have 2 dao calls, both of them running inside the CMT, if the second call fails, the first call is not rolled back. I use the TX oracle connection pool.
Is it a problem with oracle oc4j implementation?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!