• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB Transactions

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
There is no greater crime than stealing somebody's best friend. I miss you tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic