RailsExampleGroup

So I have a describe which is a subclass of RailsExampleGroup. I
inserted
some data into my database, and reconnect! my connection. Before
reconnect,
finding the data I just created is fine. The data cannot be found, after
reconnection, the data is gone. It’s not in the database. It looks to me
the
data is not actually inserted into the DB at all, just somehow buffered
somewhere. Would anybody know why? thanks.

Now the workaround is to have a separate class doing all DB operations,
but
I am still curious why RSpec does this, for speed reason?

Yi

On 23 May 2008, at 19:53, Yi Wen wrote:

It’s not in the database. It looks to me the data is not actually
inserted into the DB at all, just somehow buffered somewhere.

It’s stored in a transaction, so the only place you can see the data
is from the same connection. Make another connection (by
reconnecting) and you are protected from seeing that data.

Why do you want to see this intermediate state of the database from
another connection anyway? It’s an unusual thing to want to do.

Ashley


http://www.patchspace.co.uk/