commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DBCP-259) defualtReadOnly not working in conncetion pooling
Date Mon, 04 Feb 2008 04:37:08 GMT

    [ https://issues.apache.org/jira/browse/DBCP-259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12565262#action_12565262
] 

Phil Steitz commented on DBCP-259:
----------------------------------

I am not an expert on how the Oracle driver handles these things, so I can't help much other
than to explain what DBCP's PoolableConnectionFactory (PCF) does.  Assuming you are using
a pool with PCF as the factory and the constructor mentioned above, the sequence should be


1. getConnection or borrowObject directly from the pool causes a connection to get created
using PCF's makeObject or returns one from the pool.  Newly created connections do not have
readOnly or autoCommit set.
2. commons pool's borrowObject then calls the PCF activateObject method.  In that method,
the autoCommit and readOnly properties are set *in that order* - i.e. in the reverse order
from what you have in you "flat connection" example.  

If you can identify a bug in DBCP (e.g. somehow setting the properties in the order that we
do is not good), we can leave this issue open and find a solution here.  Otherwise, we should
close this and address further questions on the commons-user or Oracle lists.

> defualtReadOnly not working in conncetion pooling
> -------------------------------------------------
>
>                 Key: DBCP-259
>                 URL: https://issues.apache.org/jira/browse/DBCP-259
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.2.1
>         Environment: commons-pool 1.2, jdk 1.4
>            Reporter: Raghu
>
> Hi All
> I am trying to set up a connection pooling using Jakarta commons-dbcp 1.2.1....
> When defaultReadOnly property is set to true and if my understanding is correct i would
not be able to perform update,insert or delete operations.
> When i set defualtReadOnly as true in the constructor PoolableConnectionFactory which
looks like -
> poolableConnectionFactory = new PoolableConnectionFactory(
>                     connectionFactory, connectionPool, null,
>                     "sql query", true, true);
> But still i am able to perform the delete or insert opertations where i am expecting
to throw an excpetion.
> Am i missing some thing or is ther anything fishy???
> Thanks

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message