public void initDB(){
  wasAccessed=true;
  if (factory == null) {
    factory=new EvoEntityManagerFactory();
    createNewEntityManager();
  }
 else {
    factory.clearAllEntityManagers();
    if (!factory.isOpen()) {
      factory=new EvoEntityManagerFactory();
    }
    createNewEntityManager();
    clearDatabase();
  }
}

public void initDB ( ) { wasAccessed = true ; if ( factory == null ) { factory = new EvoEntityManagerFactory ( ) ; createNewEntityManager ( ) ; } else { factory . clearAllEntityManagers ( ) ; if ( ! factory . isOpen ( ) ) { factory = new EvoEntityManagerFactory ( ) ; } createNewEntityManager ( ) ; clearDatabase ( ) ; } }
be sure the database is ready to use . this means for example rolling back any activate transaction and delete all tables
