-->
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.  [ 3 posts ] 
Author Message
 Post subject: Coexist Hibernate with Legacy JDBC code
PostPosted: Thu Feb 05, 2004 2:40 pm 
Newbie

Joined: Thu Feb 05, 2004 11:39 am
Posts: 2
Hello All:

We have an Application that runs within the Tomcat container. The persistence layer is coded using JDBC.

I have been looking into Hibernate and of course and very impressed. I would want us to move our persistence layer to use Hibernate.

However I do not see getting permission to change the entire existing JDBC code to Hibernate. Not at one shot. There is just too much of it. I do see the opportunity to use Hibernate in the new features we plan to add. Hopefully we will be able to move the persistence layer to completely use Hibernate over time.

The questions I have are;
- Can Hibernate co-exists with existing JDBC code?
- Has anyone tried this configuration? Please share your experience
- Is there a set of guidelines to be followed to achieve this?

Looking foward to your feedback and comments. Thank you.

Gowtham.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 05, 2004 3:39 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
It depends, but mostly yes.
Hibernate coexist pretty well with concurrent access to DB (even from non Java world).
Hibernate allows you to give to it the underlying JDBC connection.
Hibernate allows you to access the underlying JDBC connection.
Thus concurrent modification within the same Tx is pretty easy.

But:
Hibernate use at least 1 level of cache (the session one). So changing an object on Hibernate and at the same time sneakily modify the associated row using the same connection will lead to strange behavior. Otherwise Tx demarcation will protect you pretty well.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 06, 2004 11:50 am 
Newbie

Joined: Thu Feb 05, 2004 11:39 am
Posts: 2
Thank you for the advise. Will try it out and if successful will update the board.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.