[Grok-dev] Re: megrok.rdb updated

Martijn Faassen faassen at startifact.com
Thu Jun 26 07:34:30 EDT 2008


Laurence Rowe wrote:
> Martijn Faassen wrote:
>> Sebastian Ware wrote:
>>> 25 jun 2008 kl. 17.15 skrev Martijn Faassen:
>>>
>>>> They are two operations though: adding an object to the relational 
>>>> database and changing the record so it's added to the container.
>>>
>>> Does this require two writes to the db? (hoping not...)
>>
>> No, I think the writing happens at the end of the Zope transaction, 
>> just like it does with the ZODB. That said, I'm not sure what the SQL 
>> looks like.
> 
> I think that you may need two round trips to support auto-generated 
> primary keys. In collective.tin I do something like this:
> 
> 
>    session = rdb.Session()
>    session.add(department)
>    session.flush()
>    self.context.set(department)

Thanks for the hint, I'll try that.

Regards,

Martijn



More information about the Grok-dev mailing list