[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Problems with JPA/Hibernate persist

jharby1 do-not-reply at jboss.com
Tue Nov 25 14:41:20 EST 2008


I am having problems with EntityManager.persist - I am not getting any errors but on this insert I'm trying below nothing is going in the database (MS SQLServer). This is running in JBoss from an SLSB so I am using the CMT. In some prior methods I am successfully populating some objects from the DB using find so I know the connection is ok. Has anyone else run into this.


  | private int insertLockRecord(PolicyFundingInfo policyFundingInfo) {
  |         EntityManagerFactory emf = Persistence.createEntityManagerFactory("PolicyPersistenceUnit");
  |         EntityManager em = emf.createEntityManager();
  |         RecordlockEntity recordlockEntity = new RecordlockEntity();
  |         recordlockEntity.setUsername("PolicyServ");
  |         recordlockEntity.setLockdate(new Timestamp(new Date().getTime()));
  |         recordlockEntity.setRecordkey(Integer.toString(policyFundingInfo.getCertmainseqno()));
  |         recordlockEntity.setRecordtype("POL");
  |         try {
  |             em.persist(recordlockEntity);
  |         }
  |         catch (Throwable e) {
  |             e.printStackTrace();
  |         }
  |         Integer recordLockKey = new Integer(0);
  |         em.close();
  |         return recordLockKey.intValue();
  |     }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4192262#4192262

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4192262



More information about the jboss-user mailing list