users@glassfish.java.net

Re: Is it possible to run a SQL statement each new JDBC connection?

From: <glassfish_at_javadesktop.org>
Date: Wed, 25 Nov 2009 06:31:14 PST

Is there any way (at first with GlassFish 2.1.1) so run own SQLs like setting special Transactions levels.

MS SQL provide an additional transaction level SNAPSHOT, that would be nice to use.

According to documentation, I've to configure transaction with "SET TRANSACTION ISOLATION LEVEL SNAPSHOT" instead of e.g. "SET TRANSACTION ISOLATION LEVEL REPEATABLE READ". -> http://msdn.microsoft.com/en-us/library/ms173763%28SQL.90%29.aspx

I'm able to configure transaction isolation level at connection pools, but only the standard levels "READ UNCOMMITTED", "READ COMMITTED", " REPEATABLE READ" and "SERIALIZABLE".

The other option would be to set via Java code, but that is not possible in EJB containers:
conn2.setTransactionIsolation(4096); //4096 corresponds to SQLServerConnection.TRANSACTION_SNAPSHOT
-> http://blogs.msdn.com/angelsb/archive/2006/08/24/719013.aspx

Additional I want to setup some other DBMS special setting like this lock timeout.

Would this work with the GF3 feature InitSQL?

Thanks a lot
[Message sent by forum member 'hegalor' ]

http://forums.java.net/jive/thread.jspa?messageID=373315