Hi Thomas,

Thomas Franke wrote:
Hello there,

we use in one case Informix and the
org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl as the sequence
manager.
First it seemed good but then we must realize that we can't create a new record,
if we didn't create a record in the rdbms before using OJB.
So if we want to create a new record over OJB we have to create a record in a
certain table before so that at least one PK exist. After that OJB is able to
create the autoincrement keys. I know it's weird.

Does OJB cause an error? Could you post the whole stack trace?


At the moment I have no ideas because I don't know how this sequence manager 
works.

Any suggestions are welcome! :)

Have a look in method
SequenceManagerHighLowImpl#lookupStoreSequence(PersistenceBroker broker, FieldDescriptor field, String seqName)
this method is called to store/lookup a HighLowSequence instance.

OJB first lookup a HighLowSequence instance from DB based on the sequence name. If not found OJB try to read the max key of the target column (using: SELECT MAX(column) FROM table). The returned value is used as start value for the new HighLowSequence object. OJB obtain a new PB instance (separate connection) to store/update the HighLowSequence object to avoid problems on rollback of tx of the main PB instance.

regards,
Armin


Regards,

Thomas

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



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

Reply via email to