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: Hibernate and JDBC within same transaction
PostPosted: Thu Nov 13, 2003 3:13 am 
Regular
Regular

Joined: Thu Nov 13, 2003 2:55 am
Posts: 71
Location: Sweden
I'm planning to move to Hibernate using a J2EE DataSource for connection pooling and JTA transactions.

Could I mix Hibernate and JDBC within the same transaction?
What if I access/update the same table with both Hibernate and JDBC within the same transaction?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 13, 2003 5:23 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
GDay Mate - sorry could not help myself. :-)

Yes you can use both during the same transaction, Get the JDBC connection from the session. Database will be updated appropriately by the transaction.
You will loose caching benefits where same issues apply if the data was updated from another source.


Top
 Profile  
 
 Post subject: How
PostPosted: Thu Nov 13, 2003 6:13 am 
Regular
Regular

Joined: Thu Nov 13, 2003 2:55 am
Posts: 71
Location: Sweden
david wrote:
You will loose caching benefits where same issues apply if the data was updated from another source.


How do you mean?
Will I have to turn caching of by some setting?
Or will Hibernate detect that my database is "dirty" and re-read?


Top
 Profile  
 
 Post subject: Re: How
PostPosted: Thu Nov 13, 2003 9:03 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
mate wrote:
How do you mean?
Will I have to turn caching of by some setting?
Or will Hibernate detect that my database is "dirty" and re-read?


Hibernate cannot see what you did to the DB, so object cache will not be updated or dirtied by Hibernate. You have to do it manually by refreshing some object.

_________________
Emmanuel


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.