-->
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: How to obtain connection metadata
PostPosted: Fri Jan 12, 2007 9:47 am 
Newbie

Joined: Tue Sep 12, 2006 3:19 am
Posts: 6
Hello,

I'm using hibernate through the ejb/entitymanager.

In order to close down my database correctly, I'd like to obtain information like the "hibernate.connection.url" and the "hibernate.dialect" as they are specified in the persistence.xml (META-INF).
How can I do so ?
My interface with the database is throught the EntityManager(Factory).

Can one for instance get a list of the persistence-units in that same xml ?

Ideas ?

Geert


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 12, 2007 8:14 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I don't understand, HEM does manage the connections for you, you don't have to close them.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 14, 2007 12:21 pm 
Newbie

Joined: Tue Sep 12, 2006 3:19 am
Posts: 6
I'm using Hibernate in a Swing application with a connection to an embedded Derby database.
As the application closes, I'd like to nicely close the db as well.
To do so, I need the db url.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 21, 2007 7:06 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
there is no easy way. Using an Ejb3Configuration object will give you access to the properties though

_________________
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.