[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Hibernate Increment causing problem

kasinath do-not-reply at jboss.com
Thu Mar 15 18:52:55 EDT 2007


Hi,
   I am peristing data into single table in oracle.. I am not using sequence at all. I am using hibernate increment in hbm file. 
  | public class TestLwot {
  | 
  |     
  |     public static void main(String[] args) {
  |         MakeLwotObj makeLwotObj= new MakeLwotObj ();
  |         LWOTDao lwotDao = new LWOTDaoImpl();
  |         lwotDao.persistLWOTPatient(makeLwotObj.getLwot());   // IT CALLS SAVE OR UPDATE OF HIBERNATE
  | // makeLwotObj.getLwot() returns LwotObject.. which does not contain any id.. id field is null..
  |         
  |         try {
  |             Thread.sleep(30 * 1000);  
  |             lwotDao.persistLWOTPatient(makeLwotObj.getLwot()); // IT CALLS SAVE OR UPDATE OF HIBERNATE
  | 
  |         } catch (InterruptedException e) {
  |             // TODO Auto-generated catch block
  |             e.printStackTrace();
  |         }
  | 
  |     }
  | 
  |    
  | }


I am trying to run the SAVEORUPDATE using 2 jvm's then its failing with en exception stating that 
  | ORA-00001: unique constraint (DATEAM.SYS_C0039965) violated
  | 


Does any body has any ideas why it is doing that






You get this problem when u  run this code from different system's or through Different JVM's.

Thanks
Kasinath

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

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



More information about the jboss-user mailing list