Philip G wrote:
> 
> As I know it, sequences aren't affected by your transactions nor are they
> limited to your current session.
> 

Kind of both.  The sequence state is in the schema, it's outside of the
scope of your current session.  It has to do this so the database server can
guarantee that no value will be allocated to multiple clients.  

But CURRVAL is scoped to your current session, because it reports the last
value _you_ generated during your current session, not the last value
generated by the sequence for any client.  Note that CURRVAL reports nothing
(or an error) if you call it before you've called NEXTVAL during the current
session.

Sequences are totally outside transaction scope.

If you think about it, this is the only way that makes sense for sequences
to work.  All brands of database should implement auto-generation mechanisms
in this way.

I'm focusing on this topic because I think your earlier statements indicate
that you think there's a concurrency issue with using sequences in a
high-volume environment.  I don't think you need to worry, sequences are
designed to solve this issue.  You can talk to your DBA to confirm this.

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

Reply via email to