-->
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.  [ 2 posts ] 
Author Message
 Post subject: Integrate with old jdbc-based code?
PostPosted: Tue Aug 09, 2005 6:15 pm 
Newbie

Joined: Tue Aug 09, 2005 4:55 pm
Posts: 1
I'm trying to slowly modernize a DAO-based EJB 1.0 app. The existing code operates on raw jdbc connections, opens a connection-level transaction and hands me the connection (it will also commit the connection once the call to my new code is done). I now like to open an entity manager on top of this connection. While it's possible by subclassing the HibernateEntityManager (overwriting openSession()), I am looking for a better way to do this and haven't been able to find one.

Ideas? Besides rewriting all legacy code? :-)

Cheers,
Jochen


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 11, 2005 5:29 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Why don't you refer to the Datasource in your config and get rid of the connection code?
Otherwise use the Hibernate SessionFactory.openSession(Connection).

I'm quite -1 in adding this method to the EM.

_________________
Emmanuel


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