On 24/04/2010 4:36 AM, Jeremy Evans wrote:
The ADODB.Connection object that the ADO adapter creates apparently
does not provide a consistent connection to the server. For example,
if you send the BEGIN TRANSACTION sql query and then the COMMIT
TRANSACTION sql query using the connection object provided, you get an
error because the same connection to the server is not used for both.
Give it a shot using the connection object directly, which is fairly
easy in Sequel:
DB.synchronize do |c|
c.Execute("BEGIN TRANSACTION")
c.Execute("COMMIT TRANSACTION")
end
If you can get it working correctly, you might want to take a look at
the ADO adapter and see if Sequel is doing something wrong.
OK, I've poked around a bit by using a trace on a SQL Server backend.
The fundamental issue appears to be the Sequel (via whatever means) is
getting a new connection for EVERY statement issued to the server. This
is obviously BAD, and not just for transactions. Temporary tables which
persist and are visible only for a connection would fail miserably too.
Probably a few other things.....
Unfortunately I don't know what is causing this. It's certainly not the
SQLOLEDB driver as that is used in lots of places, including the .NET
SQL adapters. I've used it from an old VB app and in a large ASP.NET
application without any problems at all, it certainly doesn't create a
connection on each statement!
I can't see anything in Sequel on first glance. It's possible that it's
the win32ole ruby library that's the problem, but I don't really want to
look in there ;)
I'll try some more tests when I get the chance to see if I can nail it
down further. If it can't be fixed then it should probably be dumped as
I suspect that people will run into may problems and not just with
transactions. As a minimum there should be a big warning in the docs
that various operations may fail.
Cheers,
Gary.
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" 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/sequel-talk?hl=en.