Philip G wrote:
> 
> As for using lastSequenceId(), bad mojo. Using Zend_Db's default
> auto-commit
> settings, it's extremely easy to get sequence ids crossed during heavy
> loads, and thus causing all sorts of problems. 
> 

I'm not sure I understand this statement.

I'm pretty sure CURRVAL is limited to the scope of the current database
session; that's the only way it would be useful.  That is, if I generate a
value 1234 with NEXTVAL, then CURRVAL will continue to report 1234 to me
repeatedly during my session, even if you continue to use NEXTVAL to advance
the sequence in your session.  CURRVAL will report different numbers; it's
always the number we each last generated in our respective sessions.

Also, sequences are not affected by transactions.  You cannot roll back a
call to NEXTVAL and "return" a value to the sequence.  Also if I generate a
value 1234, then you generate a value, you will get 1235 regardless of
whether I have committed or not, and regardless of the transaction isolation
mode either of us are using.  Sequences must ignore transaction scope, in
order to maintain uniqueness.

But perhaps there's something else that I don't know about your situation. 
I'm curious to hear about it, since I'm not an Oracle expert specifically.

Regards,
Bill Karwin
-- 
View this message in context: 
http://www.nabble.com/Zend_Db-PDO-OCI-Oracle-%2B-RETURNING-clause-tp18852478p18855926.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to