Author: John Fabiani
Posted: 2012-05-03 at 13:02:05
On Thursday, May 03, 2012 10:04:40 AM Paul McNett wrote:
> You can't ask the database for the last insert id until the database has
> inserted the record. The database won't insert the record until you call
> biz.save(), which you don't want to do inside the loop. You also don't want
> to guess at what the database will assign for the key because another user
> could have beaten you to it, among other reasons.
FYI - postgres does not work as you suggest.
You are able to retrieve the PK without commit (within the same session).
So if I insert a record I can retrieve the PK without a commit.
see Currval()
Johnf
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/4914167.CYJvVD1Zxy@linux-12