You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Berin Loritsch <bl...@apache.org> on 2003/03/04 18:48:41 UTC

[Proposal] DataSource refactoring

I would like to refactor the way DataSource creates and maintains
connections so that the same binary works with both JDK 1.3 and
JDK 1.4.

In order to do this, we have to use the Proxy object and turn the
AbstractJdbcConnection into an InvocationHandler that dynamically
generates a Connection wrapper for your system.

It *should* work very well.  I will try to make sure everything is
still backwards compatible, but certain classes will be deprecated
because they really won't be needed any more.

What do you all think?


Re: [Proposal] DataSource refactoring

Posted by Berin Loritsch <bl...@apache.org>.
Noel J. Bergman wrote:
> Berin,
> 
> For clarity, is this your response to Peter Goldstein's message "Avalon
> Containers and DataSources"?  Or have you not had time to review that, yet?

No, I have not been able to review that yet.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


RE: [Proposal] DataSource refactoring

Posted by "Noel J. Bergman" <no...@devtech.com>.
Berin,

For clarity, is this your response to Peter Goldstein's message "Avalon
Containers and DataSources"?  Or have you not had time to review that, yet?

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: [Proposal] DataSource refactoring

Posted by Berin Loritsch <bl...@apache.org>.
Berin Loritsch wrote:
> I would like to refactor the way DataSource creates and maintains
> connections so that the same binary works with both JDK 1.3 and
> JDK 1.4.
> 
> In order to do this, we have to use the Proxy object and turn the
> AbstractJdbcConnection into an InvocationHandler that dynamically
> generates a Connection wrapper for your system.
> 
> It *should* work very well.  I will try to make sure everything is
> still backwards compatible, but certain classes will be deprecated
> because they really won't be needed any more.
> 
> What do you all think?

I am almost done with my testing, so before I commit, I will
publish the JAR for everyone to try out.  That way you can come
up with your own oppinions.  If there are no problems, I will
commit my changes.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: [Proposal] DataSource refactoring

Posted by Berin Loritsch <bl...@apache.org>.
Torsten Curdt wrote:
> Berin Loritsch wrote:
> 
>> I would like to refactor the way DataSource creates and maintains
>> connections so that the same binary works with both JDK 1.3 and
>> JDK 1.4.
>>
>> In order to do this, we have to use the Proxy object and turn the
>> AbstractJdbcConnection into an InvocationHandler that dynamically
>> generates a Connection wrapper for your system.
> 
> 
> Any idea/numbers how this affects performance?

Proxy objects only introduce a tiny amount of overhead.  It is too
small to be accurately measured.


Re: [Proposal] DataSource refactoring

Posted by Torsten Curdt <tc...@dff.st>.
Berin Loritsch wrote:
> I would like to refactor the way DataSource creates and maintains
> connections so that the same binary works with both JDK 1.3 and
> JDK 1.4.
> 
> In order to do this, we have to use the Proxy object and turn the
> AbstractJdbcConnection into an InvocationHandler that dynamically
> generates a Connection wrapper for your system.

Any idea/numbers how this affects performance?
--
Torsten


Re: [Proposal] DataSource refactoring

Posted by Berin Loritsch <bl...@apache.org>.
Berin Loritsch wrote:
> I would like to refactor the way DataSource creates and maintains
> connections so that the same binary works with both JDK 1.3 and
> JDK 1.4.
> 
> In order to do this, we have to use the Proxy object and turn the
> AbstractJdbcConnection into an InvocationHandler that dynamically
> generates a Connection wrapper for your system.
> 
> It *should* work very well.  I will try to make sure everything is
> still backwards compatible, but certain classes will be deprecated
> because they really won't be needed any more.
> 
> What do you all think?

I am almost done with my testing, so before I commit, I will
publish the JAR for everyone to try out.  That way you can come
up with your own oppinions.  If there are no problems, I will
commit my changes.


Re: [Proposal] DataSource refactoring

Posted by Berin Loritsch <bl...@apache.org>.
Noel J. Bergman wrote:
>>>It would nice to also leverage the optional pooling that a JDBC driver
>>>can give you under 1.4 ... if its possible.
> 
> 
>>that is a subject for the sandbox version.
> 
> 
> Peter is right.  Being able to use either DBCP or JDK 1.4 pooling, and have
> that come by default through Avalon DataSource would be a major usefulness.
> Pooling is vital.

Right now, we have three implementations:

JdbcDataSource -- which implements the pooling directly.
InformixDataSource -- which uses Informix's database pooling mechanisms.
                       It *could* be altered to be more generic and work
                       with other DataSources
J2EEDataSource -- which delegates to a JNDI context to find the
                   DataSource object and pull the Connections from there.

My thoughts on SandBox will be to directly enable JDBC 3.0 pooling
using the javax.sql.DataSource interface as the component interface.

It is designed from the ground up for what you want--the initial
scratchings are there, though not well tested.

I was also planning on putting together a default implementation of the
pooling datasource for databases that don't support it directly.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


RE: [Proposal] DataSource refactoring

Posted by "Noel J. Bergman" <no...@devtech.com>.
> > It would nice to also leverage the optional pooling that a JDBC driver
> > can give you under 1.4 ... if its possible.

> that is a subject for the sandbox version.

Peter is right.  Being able to use either DBCP or JDK 1.4 pooling, and have
that come by default through Avalon DataSource would be a major usefulness.
Pooling is vital.

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: [Proposal] DataSource refactoring

Posted by Berin Loritsch <bl...@apache.org>.
Peter Royal wrote:
> On Tuesday, March 4, 2003, at 12:48  PM, Berin Loritsch wrote:
> 
>> It *should* work very well.  I will try to make sure everything is
>> still backwards compatible, but certain classes will be deprecated
>> because they really won't be needed any more.
>>
>> What do you all think?
> 
> 
> It would nice to also leverage the optional pooling that a JDBC driver 
> can give you under 1.4 ... if its possible.

:) that is a subject for the sandbox version.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: [Proposal] DataSource refactoring

Posted by Peter Royal <pr...@apache.org>.
On Tuesday, March 4, 2003, at 12:48  PM, Berin Loritsch wrote:
> It *should* work very well.  I will try to make sure everything is
> still backwards compatible, but certain classes will be deprecated
> because they really won't be needed any more.
>
> What do you all think?

It would nice to also leverage the optional pooling that a JDBC driver 
can give you under 1.4 ... if its possible.
-pete


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org