Hi Patric, 
       
      I wonder if you are hitting this problem:
      https://bugs.eclipse.org/bugs/show_bug.cgi?id=365623 
       
      Any chance you could try a more recent version (nightly build)
      2.3.3 or 2.4? 
       
      http://www.eclipse.org/eclipselink/downloads/nightly.php 
       
      Cheers, 
      Guy 
     
    On 20/01/2012 1:26 PM, Patric Rufflar wrote:
    Hello,
       
       
      I am facing a strange issue in EclipseLink 2.1.3 at a customer
      installation.
       
      Occasionally (once a day on an average), it seems that EclipseLink
      misses an
       
      @Embedded object inside a newly persisted entity
       
      and does not insert its values.
       
      The Insert fails because some of these columns (of the embedded
      object) are
       
      defined as mandatory (db constraint). If this would not be the
      case, a data loss would be the consequence.
       
       
      Have a look at the log at level FINEST (during commit/flush):
      (anonymized)
       
       
      execute_query, UpdateObjectQuery(Table1Class (some parts left
      out...),
       
      recordInfo=CRecordInfo[colA=A, colB=C, colC=102283, colD=Wed Dec
      28 11:43:33 CET
       
      2011])
       
      execute_query,
      InsertObjectQuery(Table2Class[CompositePK=pk[col1=2, col2=6633],
       
      col3=2151225, col4=FLAG, col5=N, recordInfo=CRecordInfo[colA=A,
      colB=C,
       
      colC=102283, colD=Wed Dec 28 11:43:33 CET 2011])
       
      begin_batch_statements
       
      UPDATE TABLE_1 (COL1, COL2, COLD, COLC, COL3) VALUES (?,?,?,?,?)
       
      bind => [N, 2, 2011-12-28 11:43:33.804, 102283, 6633]
       
      end_batch_statements
       
      begin_batch_statements
       
      INSERT INTO TABLE_2 (COL3, COL5, COL4, COL2, COL1) VALUES (?, ?,
      ?, ?, ?) <---
       
      CRecordInfo Cols are missing!
       
      bind => [2151225, N, FLAG, 2, 6633]
       
      end_batch_statements
       
       
       
      Local Exception Stack:
       
      Exception [EclipseLink-4002] (Eclipse Persistence Services -
       
      2.1.3.v20110304-r9073):
      org.eclipse.persistence.exceptions.DatabaseException
       
      Internal Exception: java.sql.BatchUpdateException: ORA-01400:
      cannot insert NULL
       
      into ("PRODUCT"."TABLE_2"."COLC")
       
       
      Error Code: 1400
       
       
       
      The problem seems to be unrelated to specific entities/tables, it
      happens with
       
      any kind of entities (all of them contain the same Embedded
      entity)
       
      Maybe it related with Batch Writing, but that is just a guess.
       
       
      Database is Oracle 10.2.
       
      The customer is not able to reproduce it - but it happens from
      time to time more or less regularly.
       
      I was also not able to reproduce this in any other environment.
       
       
      Why doesn't EclipseLink insert the columns of the embedded
       
      object (colA,colB ...)? The embedded object and its values do
      clearly exist
       
      (which you can see in line 2 of the log while printing the
      InsertObjectQuery).
       
      Another embedded object of the same type (CRecordInfo) is
      successfully
       
      processed in the UpdateQuery right before the errornous insert, as
      you can see in the log, too.
       
       
      Any help is appreciated. Thank you in advance.
       
       
      Best regards,
       
      Patric
       
      _______________________________________________
       
      eclipselink-users mailing list
       
      eclipselink-users@xxxxxxxxxxx
       
      https://dev.eclipse.org/mailman/listinfo/eclipselink-users
       
     
  
 |