You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by "Rios, Hector" <He...@de.rolandberger.com> on 2004/11/19 18:13:42 UTC

ISolation levels

Hi there,

I am relatively new to Sql Maps and was unsure of how to implement 
different isolation levels using Sql Maps

I need to implement Synchronized isolation level. Can anyone post an
example
of how I would do this.

I have something like this but I don't think this is exactly right.

		SqlMapClient client =
SqlMapClientFactory.getSqlMapInstance();
		Connection cn = null;				
		try
		{
		    cn = client.getDataSource().getConnection();
		    int defaultIsolation = cn.getTransactionIsolation();
	
cn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
		    client.setUserConnection(cn);
		    client.startTransaction();			
		    client.insert(queryName,input);			
		    client.commitTransaction();
		}
		finally
		{		    
			client.endTransaction();
			cn.close();
		}

TIA

-Hector
Please inform us immediately if this e-mail and/or any attachment was 
transmitted incompletely or was not intelligible.
______________________________________________________________

This e-mail and any attachment is for authorized use by the intended 
recipient(s) only. It may contain proprietary material, confidential 
information and/or be subject to legal privilege. It should not be
copied, 
disclosed to, retained or used by any other party. 
If you are not an intended recipient then please promptly delete this 
e-mail and any attachment and all copies and inform the sender.