-->
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: Transaction API vs. plain session
PostPosted: Fri Oct 01, 2004 8:48 am 
Newbie

Joined: Wed Aug 25, 2004 10:54 am
Posts: 12
Hibernate version: 2.1.4

Name and version of the database you are using:Oracle 9i

I would like to know if there is any benefit of not using Transaction in Session for read-only queries (Session still managed by Hibernate, not JDBC), since it seems to work. Does Transaction mean any unnecessary overhead? Is there any risk of not using it in select-only use case?

Thanks

AJR


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 01, 2004 11:21 am 
Senior
Senior

Joined: Sun Jan 04, 2004 2:46 pm
Posts: 147
99% of the time you can get away without doing it but there is virtually no overhead in wrapping with a transaction. I have had funny bugs/behaviour when not using the transaction under certain combos of DB/JDBC driver/connection pool so I would say wrap everything with a transaction to be on the safe side.

Oracle in particular can be a bit funny when doing things without a proper transaction, you find after a while it errors complaining about too many cursors open or something similar.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 01, 2004 11:33 am 
Newbie

Joined: Wed Aug 25, 2004 10:54 am
Posts: 12
Thanks a lot, that was the exact explanation I was looking for.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 01, 2004 1:43 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
i will add that not managing explicitly the transactions is worst for performance.

We had an example app where development team "forgot" to call begin and commit (for huge queries), the stress tests were not good.

We reworked all this to have a nice transaction management (via hibernate transaction api) for these "read only" queries, the performance was really really better.

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


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.