..How about... for example:
Properties properties = new Properties();
properties.put(TopLinkProperties.JDBC_URL, dataBaseName);
EntityManagerFactory BackUpEntityManagerFactory = javax.persistence.Persistence.createEntityManagerFactory("BackUp2008", properties);
EntityManager BackupEntityManager1 = (EntityManager) BackUpEntityManagerFactory.createEntityManager(properties);
try {
....
catch(Exception ex) {
System.out.println("------> Error: " + ex.getMessage());
// BackupEntityManager.getTransaction().rollback();
} finally {
BackupEntityManager1.close();
BackUpEntityManagerFactory.close();
}
seems to work without any problems!
[Message sent by forum member 'wei2008' (wei2008)]
http://forums.java.net/jive/thread.jspa?messageID=270245