On 7/30/01 12:35 PM, "Diethelm Guallar, Gonzalo"
<[EMAIL PROTECTED]> wrote:

>>> Is it possible to plug a different implementation of a DB pool into
>>> Turbine's service, so that the rest of the code does not change, but
>>> now the servlet is using, say, Resin's DB pool? What requirements
>>> would a DB pool (such as Resin's) implementation have in order for
>>> it to be pluggable? Does this make any sense?
>> 
>> It is currently not possible to use another connection pool with
>> Torque, but it is something that will be addressed shortly because
>> if Torque is going to be a general persistence layer than the
>> connection _must_ be pluggable.
> 
> Is there any "standard" way of doing this? I mean, would it be
> enough for Turbine's DB pool to implement some interface(s) to
> make it pluggable? A la "J2EE DB Pool API"?
> 

Yes, there are standard ways of doing this. Jon tried this a
while back and I'm not exactly sure why he stopped.
He was trying to convince Craig to use
the Turbine connection pool instead of making another one for struts,
but Turbine's connection pool carries a lot of baggage and
the peer system is coupled with it because everything uses
a DBConnection (which is specific to the Turbine connection pool)
instead of a Connection. I'm sure with a little work Torque
could be made to use pluggable connection pools.

If you're going to look at it one thing I was going to do with
the adapters is put all the info in the adapters in xml config
files and create objects using the digester. Those adapters
pretty much have static config info in them so we could get
rid of them all and simply put the info in xml.

The other thing I wanted to do was pull in the bits of village
that are used so that everything in Torque is self contained. After
looking at it for a while I've noticed some duplicated code. The
peers for example duplicate the deletion of multiple rows because
village throws an exception when multiple rows are deleted.

If we pull in the bits from village than we can see the whole picture
as a self-contained persistence layer and than start refactoring
everything, making objects thread safe, dealing with caching and
all the stuff required for an industrial strength persistence
layer.

If you want to try and make Torque use a DataSource connection pool
that would be great!


-- 

jvz.

Jason van Zyl

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to