• Post Reply Bookmark Topic Watch Topic
  • New Topic

Tables get locked while persisting data

 
Mani joshi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am using EJB 3 CMP stateless beans(entity manager) for persisting data in the oracle database.
While inserting the database tables gets locked untill commit takes place i.e. I am unable to insert two records simultaneously in the database.
Please help so that I can remove table locks!!!
 
Anurag Blore
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure about Oracle but by default the loc level should be at row level but it seems its on table level in you case. Please check with a dba about your db setting.

What type of operation is happening with your application?
 
Mani joshi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for reply...
Actually we want to insert multiple rows in a table..for this we are using em.persist in for loop....and as we are using EJB3.0 CMP stateless session bean(OC4j app server) ,these transactions get commited only at the end of the session bean's method.... so while this method runs....we were nt able to insert other rows in the same table.We have not changed any isolation levels etc for our application...all are at default levels....
How to set Isolation levels and locking modes for ejb3.0 application...
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

We have not changed any isolation levels etc for our application...all are at default levels....

Sounds like someone has. Oracle's default locking level will be row locks for updates and inserts and it never escalates locks so something must be asking for a table lock.
 
Mani joshi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what this something can be..which locks the table ? Any idea/Hint.......I also tested with no foreign key references in the table...bt the same problem exists........Is there any way by which I can check what are the various parametrs(defaults) set in my ejb 3 application....
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!