• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB Transactions

 
Vijay P
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am facing a transactions problems in EJB

I am starting a transaction with attribute "REQUIRED" and then i am updating a table through an entity bean.

After few method calls with in the same transaction i am starting one more Transaction with atrribute "RequiresNew". In this i am selecting the rows in the same table which i had used to update earlier. This select query is done through plan JDBC call. This select query includes the record that i have updated earlier.

The problem is when i am executing pstm.executeQuery().. on that table the table is getting locked and i am not able to move farward...

I fired the same 'select' from db2: prompt but the query is getting hanged, it was not executing.

Can anybody help me ...in this one
 
Vinay Raj
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is with the manner in which DB2 works on data. Irrespective of READ or WRITE operations, DB2 takes a lock on the row. That is why doing a SELECT in a different transaction fails, as the earlier UPDATE lock on the row is not released.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!