Hi Ken,

You have to use either a specific SequenceManager or must provide
intelligent instance callbacks:
1. see
http://cvs.apache.org/viewcvs/jakarta-ojb/src/java/org/apache/ojb/broker/uti
l/sequence/SequenceManagerMySQLImpl.java?rev=HEAD&content-type=text/vnd.view
cvs-markup for a MySql SeqMan

2. See http://jakarta.apache.org/ojb/tutorial3.html#instance%20callbacks for
a sample on reflecting back incremented in the DB back to the persistent
instace.

cheers,
Thomas

> -----Ursprüngliche Nachricht-----
> Von: Ken Brewer [mailto:[EMAIL PROTECTED]]
> Gesendet: Montag, 27. Januar 2003 18:17
> An: [EMAIL PROTECTED]
> Betreff: hsqldb identity problem
> 
> 
> 
> 
> I'm using hsqldb. My tables have IDENTITY type primary keys. 
> This column
> is automatically populated by the db with the next integer. I 
> would like
> to retain the ability to perform batch/debug inserts with 
> SQL. For this
> reason, I expect that I can't use the ojb sequence managers 
> because they
> wouldn't be aware of pk values inserted by the db using sql. 
> I've tried
> to store a new object but ojb tries to do an update of the 
> record where
> the pk = null instead of an insert. It seems that ojb doesn't 
> recognize
> my store invocation to be storing an new object but rather tries to do
> an update. I've read many similar problems in the archive but no
> responses have a good solution.
> 
> Thanks for you help in advance.
> 
> Ken
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 
> 


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

Reply via email to