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 Connection.TRANSACTION_SERIALIZABLE 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
 void onAcquire(java.sql.Connection connection, java.lang.String parentDataSourceIdentityToken)
           
 void onCheckOut(java.sql.Connection connection, java.lang.String parentDataSourceIdentityToken)
           
 
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(java.sql.Connection connection,
                      java.lang.String parentDataSourceIdentityToken)
               throws java.lang.Exception
Specified by:
onAcquire in interface com.mchange.v2.c3p0.ConnectionCustomizer
Overrides:
onAcquire in class com.mchange.v2.c3p0.AbstractConnectionCustomizer
Throws:
java.lang.Exception

onCheckOut

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


Copyright © 2012 evolveum. All Rights Reserved.