Hi,

I'm not sure whether this is possible with the current implementation of the Id generation, which uses two steps. In the first step, Torque gets the id out of the id table (id method idbroker) or sequence (id method native) and in the second step, the insert is done. The only possibility I'd see is to use a rollback to restore the state of the database before the error. I guess this is not possible ussing the id broker, for as far as I know, it uses a separate db connection and thus runs in another transaction as the insert. I'm not so sure about sequences, but as you said it would jump ids,it seems that sequences live outside transactiond and thus never get restored to their previous value if a rollback is issued.

I'm afraid I do not know an easy way to achieve what you want.

    Thomas

On Mon, 8 May 2006, Wizard of OS wrote:

Hi,

just installed happily torque for oracle and declared this table:

<table name="FAN" idMethod="native">
   <column name="FAN_ID" required="true" primaryKey="true" type="INTEGER"/>
   <column name="FIRST_NAME" required="true" size="128" type="VARCHAR"/>
   <column name="PASSWORD" required="true" size="32" type="VARCHAR"/>
   <column name="EMAIL" required="true" size="128" type="VARCHAR"/>
   <unique>
        <unique-column name="EMAIL"/>
   </unique>
 </table>

Adding someone once is very fine with torque and ID gets incremented.
now I provoked a unique constraint violation with adding someone else with the same email address. The DB rejected of course and torque threw an exception. Adding another set of data with a distinct email adresses created instead of ID =2 => ID = 3.
Seems like the failed torque command incremented the ID anyway.

how can I avoid this?
It is extremely unpleasent.
idMethod=idbroker does the same error!

bye

thx in advance

---------------------------------------------------------------------
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