Ver Mensaje Individual
  #6  
Antiguo 09-01-2008
Avatar de duilioisola
[duilioisola] duilioisola is offline
Miembro Premium
 
Registrado: ago 2007
Ubicación: Barcelona, España
Posts: 1.806
Reputación: 22
duilioisola Es un diamante en brutoduilioisola Es un diamante en brutoduilioisola Es un diamante en bruto
http://www.firebirdsql.org/pdfmanual...ator-Guide.pdf
Página 7

Cita:
Generators and transactions
As said, generators live outside of transaction control. This simply means you cannot safely
“rollback” generators inside a transaction. There may be other transactions executing at the same time
that change the value while your transaction runs. So once you have requested a generator value, consider
it as “gone forever”.
When you start a transaction and then call a generator and get a value of – let's say – 5, it will remain
at that value even if you roll back the transaction (!). Don't even think of something like “OK, when
I rollback, I can just do GEN_ID(mygen,-1) afterwards to set it back to 4”. This may work most of the
time, but is unsafe because other concurrent transactions may have changed the value in between. For
the same reason it doesn't make sense to get the current value with GEN_ID(mygen,0) and then increment
the value on the client side.
Los generadores trabajan fuera de las transacciones, por lo que puede darse el caso de que haya pasado por el Trigger Before, incrementado el valor y luego haya generado una excepción que no ejecute el trigger After.

No es necesario ningún corte de corriente ni nada especial para generar este error.
Responder Con Cita