Community

How to define a read-only connection ?

reply from Adrian Brock in JCA - View the full discussion

Roberto Mazzola wrote:

 

I try it but it doesn't works.

 

I change my DS to

 

<connection-property name="readOnly" type="java.lang.Boolean">true</connection-property>

 

 

It reply always "false".

 

I try different way.. also using java standalone class but the only  way is to invoke directly the setReadOnly method on the connection

 

I opened also a post of IBM DB2 Forum....

 

I hope to find a solution...

 

ty

Actually that won't work.

 

I checked the dtd and there is no type="" attribute for ConnectionPropertys in -ds.xml,

only for ConfigPropertys in ra.xml

 

You might want to raise a feature request for it in JIRA?

 

If you can make your datasource XA, then you will be able to use

<xa-datasource-property name="readOnly">true</xa-datasource-property>

and it will work out the type from the setReadOnly(boolean) method.

 

For local datasources we don't know the types since we use

java.sql.Driver.connect(String, Properties);

and like I said above, there is no way to specify it.

Reply to this message by going to Community

Start a new discussion in JCA at Community