com.evolveum.midpoint.repo.sql.util
Class MidPointConnectionCustomizer

java.lang.Object
  extended by com.mchange.v2.c3p0.AbstractConnectionCustomizer
      extended by com.evolveum.midpoint.repo.sql.util.MidPointConnectionCustomizer
All Implemented Interfaces:
com.mchange.v2.c3p0.ConnectionCustomizer

public class MidPointConnectionCustomizer
extends com.mchange.v2.c3p0.AbstractConnectionCustomizer

This connection customizer forces transaction isolation level to a specified value for all connections. Because of some H2 bug, transaction isolation level has to be set ConnectionCustomizer.onCheckOut(java.sql.Connection, String) when using H2. With other databases connection is updated during ConnectionCustomizer.onAcquire(java.sql.Connection, String)

Author:
lazyman

Constructor Summary
MidPointConnectionCustomizer()
           
 
Method Summary
static TransactionIsolation getTransactionIsolation()
           
 void onAcquire(Connection connection, String parentDataSourceIdentityToken)
           
 void onCheckOut(Connection connection, String parentDataSourceIdentityToken)
           
static void setTransactionIsolation(TransactionIsolation transactionIsolation)
           
 
Methods inherited from class com.mchange.v2.c3p0.AbstractConnectionCustomizer
onCheckIn, onDestroy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MidPointConnectionCustomizer

public MidPointConnectionCustomizer()
Method Detail

onAcquire

public void onAcquire(Connection connection,
                      String parentDataSourceIdentityToken)
               throws Exception
Specified by:
onAcquire in interface com.mchange.v2.c3p0.ConnectionCustomizer
Overrides:
onAcquire in class com.mchange.v2.c3p0.AbstractConnectionCustomizer
Throws:
Exception

onCheckOut

public void onCheckOut(Connection connection,
                       String parentDataSourceIdentityToken)
                throws Exception
Specified by:
onCheckOut in interface com.mchange.v2.c3p0.ConnectionCustomizer
Overrides:
onCheckOut in class com.mchange.v2.c3p0.AbstractConnectionCustomizer
Throws:
Exception

getTransactionIsolation

public static TransactionIsolation getTransactionIsolation()

setTransactionIsolation

public static void setTransactionIsolation(TransactionIsolation transactionIsolation)


Copyright © 2013 evolveum. All Rights Reserved.