I'm reasonably sure that depending on your MySQL transaction isolation
level, if you run the same query twice inside a transaction, it'll
return the same results -- even if you've inserted data that should
appear in the second query.

Look at repeatable read here:
http://dev.mysql.com/doc/refman/5.0/en/set-transaction.html

(unless I'm just misinterpreting things)

Simon.

On Tue, Feb 1, 2011 at 18:54, Chris Mayan <[email protected]> wrote:
> :) :)
>
>> So in rough pseudo code,
>>
>> In real code:
>> https://gist.github.com/8e2403de7ad332c3c20b [1]
>
> Thanks Xavier , I'll have a play and see if the differences might be
> something else altogether.
>
>
>>
>> Running the above script says you can see your own inserts, as long as you
>> explicitly reload your association (since it gets cached). There are
>> circumstances where you won't be able to see them across transactions, but
>> that's perhaps out of scope for this question.
>>
>> This also gives you a minimal test case to play around with to see exactly
>> when, what and where is executed.
>>
>
>
> Cheers
> Chris
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby or Rails Oceania" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rails-oceania?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en.

Reply via email to