-->
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: Hibernate ConnectionProvider vrs DataSource
PostPosted: Tue Nov 09, 2004 4:01 pm 
Newbie

Joined: Tue Nov 09, 2004 3:52 pm
Posts: 1
[b]Hibernate version: 2.1[/b]

I am currently looking at integrating Hibernate into an application that already exists. This application already has its own Connection Pool (that I wrote many years ago :) ). I am now trying to get Hibernate to use MY ConnectionPool. This is actually quite easy, although I found 2 ways (both of which seem to work):

1) Implement net.sf.hibernate.connection.ConnectionProvider.
2) Implement my own javax.sql.DataSource and have IT call my ConnectionPool (this is similar to what I think the Apache projects seem to do, ie build the ConnectionPool into the DataSource itself).

Without really digging into the weeds underneath, is one of these more desirable? If I do 2 above, will Hibernate create a Pool for my ConnectionPool automatically and thus I have too many pools? Or is the default ConnectionProvider NOT pool and thus simply calls the DataSource? Is one more performant? Any other ideas?

I am a newbie to Hibernate and DataSources so I apologize if this is obvious, I am just looking for ideas from people with more experience than myself.

Thanks,
Kevin


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 09, 2004 4:11 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Both methods are equally acceptable. If you implement a DataSource, you still have to find a way to bind them to a JNDI provider. However it hast the advangatge of being more reusable if you want to access the DataSource from somewhere else.


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.