Re: [dabo-users] Importing data to linked tables

Author: Paul McNett

Posted: 2012-05-03 at 13:05:23

On 5/3/12 11:02 AM, John Fabiani wrote:

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

We were talking about retrieving the pk before biz.save(), which is before the

database knows anything about the new record.

Paul

_______________________________________________

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/4FA2C8E3.4030106@ulmcnett.com

©2012 Paul McNett