Package org.cyclos.bootstrap
Class DatabaseManager
- java.lang.Object
-
- org.cyclos.bootstrap.DatabaseManager
-
@Component("databaseManager") public class DatabaseManager extends Object
Applies the checks / automatic upgrade on the cyclos database. This class cannot inject either theJpaTransactionManagerorTransactionTemplatebecause it is used in the middle of theEntityManagerFactorycreation, and theJpaTransactionManagerrequires theEntityManagerFactoryto be ready.
-
-
Constructor Summary
Constructors Constructor Description DatabaseManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoWithCyclosInstanceLock(Runnable action)Prevents 2 Cyclos instances (even in a cluster) to execute the given action concurrentlyvoidinitialize()voidmanageDatabase(javax.persistence.EntityManagerFactory emf)Apply the database management checks
-
-
-
Method Detail
-
doWithCyclosInstanceLock
public void doWithCyclosInstanceLock(Runnable action)
Prevents 2 Cyclos instances (even in a cluster) to execute the given action concurrently
-
initialize
@PostConstruct public void initialize()
-
manageDatabase
public void manageDatabase(javax.persistence.EntityManagerFactory emf) throws SQLExceptionApply the database management checks- Throws:
SQLException
-
-