Hi,
I am getting this error on a seemingly random basis.   What I am doing is 
doing a whole bunch of inserts, and it  sometimes does not get a fresh id 
from the idbroker.  It will re-use an id for an insert.  The problem is 
that the id is a prime key, so the database chokes.

Without recompiling, I can sometimes kick off my program again, and it will 
not fail.  What I am trying to say is that it is not a coding issue.  It's 
inserting several thousand records before sometimes erroring 
out.  Sometimes I can insert thousands of records without it failing.

I am using the tdk (turbine 2.1).  I am using the idbroker.  Stack trace 
follows.  Anybody have any ideas why this is occuring, and how I can fix 
it.  I would upgrade but I have put a lot of work into my 2.1 based app and 
afraid of an upgrade, and I don't know if an upgrade would even fix it.
Thanks everyone.

   <table name="HRA" idMethod="idbroker">
     <column name="HRA_ID" required="true" primaryKey="true"  type="INTEGER"/>
   </table>

   <table name="MEDICAL_HISTORY" idMethod="idbroker">
     <column name="MEDICAL_HISTORY_ID" required="true" primaryKey="true" 
type="INTEGER"/>
     <column name="HRA_ID" required="true" type="INTEGER"/>
     <foreign-key foreignTable="HRA">
       <reference local="HRA_ID" foreign="HRA_ID"/>
     </foreign-key>
   </table>

      [java] java.sql.SQLException: Invalid argument value: Duplicate entry 
'34103' for key 1
      [java]     at org.gjt.mm.mysql.MysqlIO.sendCommand(Unknown Source)
      [java]     at org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(Unknown Source)
      [java]     at org.gjt.mm.mysql.Connection.execSQL(Unknown Source)
      [java]     at 
org.gjt.mm.mysql.PreparedStatement.executeUpdate(Unknown Source)
      [java]     at 
org.gjt.mm.mysql.PreparedStatement.executeUpdate(Unknown Source)
      [java]     at 
com.workingdogs.village.Record.saveWithInsert(Record.java:328)
      [java]     at com.workingdogs.village.Record.save(Record.java:185)
      [java]     at com.workingdogs.village.Record.save(Record.java:166)
      [java]     at 
org.apache.turbine.om.peer.BasePeer.insertOrUpdateRecord(BasePeer.java:860)
      [java]     at 
org.apache.turbine.om.peer.BasePeer.doInsert(BasePeer.java:764)
      [java]     at 
com.rhoderunner.hra.om.BaseMedicalHistoryPeer.doInsert(BaseMedicalHistoryPeer.java:138)
      [java]     at 
com.rhoderunner.hra.om.BaseMedicalHistoryPeer.doInsert(BaseMedicalHistoryPeer.java:370)
      [java]     at 
com.rhoderunner.hra.om.BaseMedicalHistory.save(BaseMedicalHistory.java:445)
      [java]     at com.rhoderunner.hra.om.BaseHra.save(BaseHra.java:4631)
      [java]     at com.rhoderunner.hra.om.BaseHra.save(BaseHra.java:4586)
      [java]     at com.rhoderunner.hra.om.BaseHra.save(BaseHra.java:4572)


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to