Re: Using a trigger with an object-relational manager

Поиск
Список
Период
Сортировка
От Rick Schumeyer
Тема Re: Using a trigger with an object-relational manager
Дата
Msg-id 46543557.1010505@ieee.org
обсуждение исходный текст
Ответ на Re: Using a trigger with an object-relational manager  (Michael Glaesemann <grzm@seespotcode.net>)
Список pgsql-general
I just realized that I was having a slight brain-freeze earlier.
ActiveRecord creates an A object first, then tells pg to INSERT it, but
nothing is actually returned by the INSERT statement.  (I assume that
Hibernate et. al would be the same).  So of course it does not see the
result of the trigger, since it does not receive a result from the
database...until reload is called.

At least I assume that is correct.
Michael Glaesemann wrote:
>
> On May 22, 2007, at 21:21 , Rick Schumeyer wrote:
>
>> The problem is that the new A object that rails gets does not see the
>> effect of the trigger.  If I call the "reload" method, then
>> everything is ok.
>
> As ActiveRecord (which I'm assuming you're using with Rails) has no
> idea of what is going on in the database (ActiveRecord doesn't have a
> concept of triggers), there's no way for it to see the effect of the
> trigger without querying the database for the latest information
> (which is what you're doing with reload).
>
> Michael Glaesemann
> grzm seespotcode net


В списке pgsql-general по дате отправления:

Предыдущее
От: PFC
Дата:
Сообщение: Re: Using a trigger with an object-relational manager
Следующее
От: "btober"
Дата:
Сообщение: Re: Integrity on large sites