FileDocCategorySizeDatePackage
DummyConnectionProvider.javaAPI DocHibernate 3.2.51218Sat Apr 23 19:18:28 BST 2005org.hibernate.test.tm

DummyConnectionProvider

public class DummyConnectionProvider extends Object implements org.hibernate.connection.ConnectionProvider
author
Gavin King

Fields Summary
org.hibernate.connection.ConnectionProvider
cp
boolean
isTransaction
Constructors Summary
Methods Summary
public voidclose()


	
public voidcloseConnection(java.sql.Connection conn)

		if (!isTransaction) conn.close();
	
public voidconfigure(java.util.Properties props)

		cp = ConnectionProviderFactory.newConnectionProvider();
	
public java.sql.ConnectiongetConnection()

		DummyTransactionManager dtm = DummyTransactionManager.INSTANCE;
		if ( dtm!=null && dtm.getCurrent()!=null && dtm.getCurrent().getConnection()!=null ) {
			isTransaction = true;
			return dtm.getCurrent().getConnection();
		}
		else {
			isTransaction = false;
			return cp.getConnection();
		}
	
public booleansupportsAggressiveRelease()

		return true;