You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Olivier Billard <ob...@jouve.fr> on 2004/04/27 09:19:38 UTC

Datasource bug or javadoc error ?

Hi Cocooners,

It may more suit for the avalon list, but since the most of the use is 
in cocoon (I guess), maybe you experimented my pb.

In the ResourceLimitingJdbcDataSource, used by default as 
DataSourceComponent in Cocoon, it is said for the auto-commit conf :
"The auto-commit attribute is used to determine the default auto-commit 
mode for the Connections returned by this DataSource."

So for me, when I get a connection via datasource.getConnection(), if I 
set auto-commit="true" in the datasource conf, the connection that I get 
has the autocommit to "true".

"Eh bé non !" (damned)
The autocommit is only set when a new instance is created by the 
connection factory, and never later...
So if you get a first connection, its autocommit is set to the value you 
put in the datasource conf, but if a connection having an autocommit to 
"false" returns to the pool, the next connection you'll get will have a 
"false" autocommit, and not the value you set in the datasource conf...

Is there a thing that misunderstood, or is this a bug ?

--
Olivier Billard


Re: Datasource bug or javadoc error ?

Posted by Sylvain Wallez <sy...@apache.org>.
Olivier Billard wrote:

> Hi Cocooners,
>
> It may more suit for the avalon list, but since the most of the use is 
> in cocoon (I guess), maybe you experimented my pb.
>
> In the ResourceLimitingJdbcDataSource, used by default as 
> DataSourceComponent in Cocoon, it is said for the auto-commit conf :
> "The auto-commit attribute is used to determine the default 
> auto-commit mode for the Connections returned by this DataSource."
>
> So for me, when I get a connection via datasource.getConnection(), if 
> I set auto-commit="true" in the datasource conf, the connection that I 
> get has the autocommit to "true".
>
> "Eh bé non !" (damned)
> The autocommit is only set when a new instance is created by the 
> connection factory, and never later...
> So if you get a first connection, its autocommit is set to the value 
> you put in the datasource conf, but if a connection having an 
> autocommit to "false" returns to the pool, the next connection you'll 
> get will have a "false" autocommit, and not the value you set in the 
> datasource conf...
>
> Is there a thing that misunderstood, or is this a bug ?


It definitely looks more like a bug than a feature...

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }