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

Raghu commented on DBCP-259:
----------------------------

Yes Phil 

Thanks for you response. I got to know that the property of ReadOnly depends on 
the driver you are using and that is absolutely correct and well understood.

Now i have a strange problem. 
I am testing this defualt readonly property in 2 different cases.
1.Just trying to obtain a connection as a flat connection -

                Class.forName("oracle.jdbc.driver.OracleDriver");
                Connection con = 
DriverManager.getConnection("url","user","paswd");
                con.setReadOnly(true);
                con.setAutoCommit(false);
                
                PreparedStatement pstmt = con.prepareStatement("DELETE 
query'");;
                        
                int x =  pstmt.executeUpdate();
                con.commit();
                con.close();
                System.out.println(x); 

Here even when i am trying to set the readOnly to true still i am able to 
perform the delete or update or insert operations...but as we know that Oracle 
JDBC driver doesnt support that i dont have any issues here....

2.In the second case i am trying to obtain a conneciton from a datasource by 
constructing a connection pooling....

now here when i am using the constructor - 

poolableConnectionFactory = new PoolableConnectionFactory(
connectionFactory, connectionPool, null,
"sql query", true, false);

i have set the auto commit as false now when i am trying to perform an udate 
query it throwing the exception.(Here also i am using the Oracle JDBC driver 
only...)

but when i am setting the constructor - 

poolableConnectionFactory = new PoolableConnectionFactory(
connectionFactory, connectionPool, null,
"sql query", true, true);

here auto commit is true....and now it is not throwing any exception.....

why is this incosistency in all these 3 cases.....

Thanks for reading my mail patiently..........




> 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.

Reply via email to