Quantcast

How is GlorpOpenDBXDriverPoolingDriver supposed to work?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How is GlorpOpenDBXDriverPoolingDriver supposed to work?

Mariano Martinez Peck
Hi guys,

There is something I don't understand. The idea with GlorpOpenDBXDriverPoolingDriver is that it takes care of opening the connections and have a pool, right?

Now...I am at the glorp side...each time I want to do something I instantiate a GlorpSession. Of course, I don't want to send #login to this session because that's what the pool would do if necessary. So say I just send a query with the session. I get a DNU because 'databaseDriver' is nil. As you can see, databaseDriver is set in PharoDatabaseAccessor >> loginIfError:.
of course, if I send #login or #loginIfError before doing the query the pool "works"...but...I am opening a connection for each query.

So I don't understand how this is supposed to work. How should I manage my Glorp sessions with this pool?

--
You received this message because you are subscribed to the Google Groups "DBXTalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How is GlorpOpenDBXDriverPoolingDriver supposed to work?

Mariano Martinez Peck
Ahhh ok...I think I got it. The magic is in  SelmaConnectionPool >> #connect:


On Tue, Jul 9, 2013 at 11:50 AM, Mariano Martinez Peck <[hidden email]> wrote:
Hi guys,

There is something I don't understand. The idea with GlorpOpenDBXDriverPoolingDriver is that it takes care of opening the connections and have a pool, right?

Now...I am at the glorp side...each time I want to do something I instantiate a GlorpSession. Of course, I don't want to send #login to this session because that's what the pool would do if necessary. So say I just send a query with the session. I get a DNU because 'databaseDriver' is nil. As you can see, databaseDriver is set in PharoDatabaseAccessor >> loginIfError:.
of course, if I send #login or #loginIfError before doing the query the pool "works"...but...I am opening a connection for each query.

So I don't understand how this is supposed to work. How should I manage my Glorp sessions with this pool?




--
Mariano
http://marianopeck.wordpress.com

--
You received this message because you are subscribed to the Google Groups "DBXTalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Loading...