You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Jeremy Hinegardner <je...@hinegardner.org> on 2008/07/29 09:03:25 UTC

use pooled connections with DataImportHandler

Hi all,

I'm using the DataImportHandler, and its working great.  What I would
like to do is configure the <dataSource> to use a pooled conncation from
our Servlet container (Jetty) instead of having the DataImportHandler
instantiate and hold a new connection for each entity in our
dataimport-config.xml (which is what it appears to be doing right now). 

I'm not sure it can though.  My quick perusal of the code seems to
indicate that it is using DriverManager.getConnection() instead of a
JNDI lookup.  I'm assuming I'm wrong here, I've been out of java
development for quite some time.  

I'd like to be able to do something along these lines:

  <dataSource name="myDB" url="java:comp/env/jdbc/myDB" />

I may be completely missing something obvious here too, for instance the
right driver="" value to put in soemthing that will get a pooled
connection from the servlet container.

enjoy,

-jeremy

-- 
========================================================================
 Jeremy Hinegardner                              jeremy@hinegardner.org 


Re: use pooled connections with DataImportHandler

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>.
Thanks a lot. This is what keeps us going :)


On Tue, Jul 29, 2008 at 8:42 PM, Jeremy Hinegardner
<je...@hinegardner.org> wrote:
> Thanks for the info. I don't really need it, I was just pondering some
> options.
>
> I noticed, anecdotally, in my logs that it didn't appear to be doing
> database queries concurrently.  It just walked the entity list.  That
> led to the conclusion that if it is doing things serially, it could
> reuse a connection between each entity with the same data source.
>
> So, just some musings from a happy user of DataImportHandler.  Thanks
> for a great module!
>
> enjoy,
>
> -jeremy
>
> On Tue, Jul 29, 2008 at 12:45:32PM +0530, Noble Paul wrote:
>> Using pooled connection may be of little use here .Because the same
>> connection is used throughout the operation that is one connection/per
>> entity. If I use a pooled connection I still need to get the same
>> no:of connections. That is why we did not have that configuration
>> If you really need it you can implement a PooledJdbcDataSource
>> --Noble
>>
>> On Tue, Jul 29, 2008 at 12:33 PM, Jeremy Hinegardner
>> <je...@hinegardner.org> wrote:
>> > Hi all,
>> >
>> > I'm using the DataImportHandler, and its working great.  What I would
>> > like to do is configure the <dataSource> to use a pooled conncation from
>> > our Servlet container (Jetty) instead of having the DataImportHandler
>> > instantiate and hold a new connection for each entity in our
>> > dataimport-config.xml (which is what it appears to be doing right now).
>> >
>> > I'm not sure it can though.  My quick perusal of the code seems to
>> > indicate that it is using DriverManager.getConnection() instead of a
>> > JNDI lookup.  I'm assuming I'm wrong here, I've been out of java
>> > development for quite some time.
>> >
>> > I'd like to be able to do something along these lines:
>> >
>> >  <dataSource name="myDB" url="java:comp/env/jdbc/myDB" />
>> >
>> > I may be completely missing something obvious here too, for instance the
>> > right driver="" value to put in soemthing that will get a pooled
>> > connection from the servlet container.
>
> --
> ========================================================================
>  Jeremy Hinegardner                              jeremy@hinegardner.org
>
>



-- 
--Noble Paul

Re: use pooled connections with DataImportHandler

Posted by Jeremy Hinegardner <je...@hinegardner.org>.
Thanks for the info. I don't really need it, I was just pondering some
options.

I noticed, anecdotally, in my logs that it didn't appear to be doing
database queries concurrently.  It just walked the entity list.  That
led to the conclusion that if it is doing things serially, it could
reuse a connection between each entity with the same data source. 

So, just some musings from a happy user of DataImportHandler.  Thanks
for a great module!

enjoy,

-jeremy

On Tue, Jul 29, 2008 at 12:45:32PM +0530, Noble Paul wrote:
> Using pooled connection may be of little use here .Because the same
> connection is used throughout the operation that is one connection/per
> entity. If I use a pooled connection I still need to get the same
> no:of connections. That is why we did not have that configuration
> If you really need it you can implement a PooledJdbcDataSource
> --Noble
> 
> On Tue, Jul 29, 2008 at 12:33 PM, Jeremy Hinegardner
> <je...@hinegardner.org> wrote:
> > Hi all,
> >
> > I'm using the DataImportHandler, and its working great.  What I would
> > like to do is configure the <dataSource> to use a pooled conncation from
> > our Servlet container (Jetty) instead of having the DataImportHandler
> > instantiate and hold a new connection for each entity in our
> > dataimport-config.xml (which is what it appears to be doing right now).
> >
> > I'm not sure it can though.  My quick perusal of the code seems to
> > indicate that it is using DriverManager.getConnection() instead of a
> > JNDI lookup.  I'm assuming I'm wrong here, I've been out of java
> > development for quite some time.
> >
> > I'd like to be able to do something along these lines:
> >
> >  <dataSource name="myDB" url="java:comp/env/jdbc/myDB" />
> >
> > I may be completely missing something obvious here too, for instance the
> > right driver="" value to put in soemthing that will get a pooled
> > connection from the servlet container.

-- 
========================================================================
 Jeremy Hinegardner                              jeremy@hinegardner.org 


Re: use pooled connections with DataImportHandler

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>.
Using pooled connection may be of little use here .Because the same
connection is used throughout the operation that is one connection/per
entity. If I use a pooled connection I still need to get the same
no:of connections. That is why we did not have that configuration
If you really need it you can implement a PooledJdbcDataSource
--Noble

On Tue, Jul 29, 2008 at 12:33 PM, Jeremy Hinegardner
<je...@hinegardner.org> wrote:
> Hi all,
>
> I'm using the DataImportHandler, and its working great.  What I would
> like to do is configure the <dataSource> to use a pooled conncation from
> our Servlet container (Jetty) instead of having the DataImportHandler
> instantiate and hold a new connection for each entity in our
> dataimport-config.xml (which is what it appears to be doing right now).
>
> I'm not sure it can though.  My quick perusal of the code seems to
> indicate that it is using DriverManager.getConnection() instead of a
> JNDI lookup.  I'm assuming I'm wrong here, I've been out of java
> development for quite some time.
>
> I'd like to be able to do something along these lines:
>
>  <dataSource name="myDB" url="java:comp/env/jdbc/myDB" />
>
> I may be completely missing something obvious here too, for instance the
> right driver="" value to put in soemthing that will get a pooled
> connection from the servlet container.
>
> enjoy,
>
> -jeremy
>
> --
> ========================================================================
>  Jeremy Hinegardner                              jeremy@hinegardner.org
>
>



-- 
--Noble Paul