0 Replies Latest reply on Mar 15, 2007 6:52 PM by kasinath Nalla

    Hibernate Increment causing problem

    kasinath Nalla Newbie

      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