[jboss-user] [JCA] New message: "How to define a read-only connection ?"

Roberto Mazzola do-not-reply at jboss.com
Sun Mar 14 10:32:24 EDT 2010

User development,

A new message was posted in the thread "How to define a read-only connection ?":


Author  : Roberto Mazzola
Profile : http://community.jboss.org/people/rmazzola

I'm trying to define a readonly connection to a IBM DB2 (9.7) database
I try several way but without success.
I read also http://community.jboss.org/message/22945#22945
this is my definition

<?xml version="1.0" encoding="UTF-8"?>
  <connection-property name="readOnly">true</connection-property>
I try also try using  new-connection-sql to "SET TRANSACTION READ ONLY" but it is not allowed on db2 9.7
To test it I have a simple JSP doing ..
public Connection getConnection(String aName)
     InitialContext vContext = new InitialContext();
  DataSource ds = (DataSource)vContext.lookup(aName);
  Connection vConnection = ds.getConnection();
  return vConnection;
 catch (Exception ex)
 return null;
Connection vConnection = getConnection("java:/nowreadonly");
System.out.println(" *** vConnection : " +vConnection );
System.out.println("*** vConnection.isReadOnly() : " + vConnection.isReadOnly());
But the isReadOnly return always false...

Any idea?
Thanks You!


To reply to this message visit the message page: http://community.jboss.org/message/531877#531877

More information about the jboss-user mailing list