These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Deadlocks while using Hibernate
PostPosted: Mon Aug 07, 2006 3:28 pm 
Newbie

Joined: Mon Aug 07, 2006 3:12 pm
Posts: 4
Hello All,

I'm using Hibernate 3.0 on WAS 5.0 server. We have multiple databases involved in the application. All of our SQLs are native SQLs defined in mapping files. The problem we are having with using Hibernate is that, it creates huge no. of locks in the database which sometimes result into deadlock situation.

All of our SQL execution goes through 1 common framework level class. Below steps are performed for SELECT execution -

1. Get current Session handle for corresponding database SessionFactory.
2. Call Session.beginTransaction
3. Call session.getNamedQuery() and execute Query with required paramaters and return query.list()
4. In finally, commit the transaction

I have below questions regarding this approach and I'd really appreciate for any help you can provide with.

1. Is it a good practice to set flushmode to FlushMode.NEVER when a SELECT sql is executed? It would avoid an overhead of startTransaction in case of readonly SELECT.
2. We made a change in the code to set isolation level to TRANSACTION_READ_UNCOMMITTED so that locks issue can be resolved. Is it recommended to use TRANSACTION_READ_UNCOMMITTED?
3. Under what conditions hibernate would cause locks in the database?

Thanks !!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 08, 2006 9:38 am 
Newbie

Joined: Mon Aug 07, 2006 3:12 pm
Posts: 4
Please help!!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 08, 2006 9:39 am 
Newbie

Joined: Mon Aug 07, 2006 3:12 pm
Posts: 4
Please help!!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 08, 2006 10:03 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
If your posting (or a question you are referring to) was not answered by anybody, the possible reasons are:

- http://www.hibernate.org/ForumMailingli ... AskForHelp
- You did not submit enough information
- Nobody knows the answer or has the free time to answer

What you can do now:

- Do the things listed in After Posting
- Add missing and/or more information
- Consider commercial support for guaranteed expert response times

This is a high-traffic forum run by volunteers with hundreds of postings made every day. The community works because people try to help others in their free time. Nobody is paid for this service or has to pay.

You should not expect a timely response and you should not rely on a public community forum for critical cases.

All community members should respect the rules of this forum and treat others like they would prefer to be treated.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.