Rails and MSSQL transactions

I have rails using a MSSQL db. The set up works fine with low volume,
but with 2+ requests/second I keep on getting the following error:

DBI::DatabaseError: Execute
OLE error code:80004005 in Microsoft OLE DB Provider for SQL Server
Cannot create new connection because in manual or distributed
transaction mode.
HRESULT error code:0x80020009
Exception occurred.: SELECT COLUMN_NAME as ColName, COLUMN_DEFAULT
as DefaultValue, DATA_TYPE as ColType, COL_LENGTH('S_RESIT

I’ve tried using transactions in rails but to no avail, if I have 10
windows open and refresh all at once, several windows will produce that

MS suggests
Use a server-side or client-side cursor other than the forward-only and
read-only (often called a firehose) cursor.

Anyone know how to do this?

Help is appreciated.


Sorry for the delay in replying - I’m on holiday in Kerala, India at
the moment. Anyway, I’d suggest using the sql server adapter in ODBC
mode rather than ado. To do this (off the top of my head) you need a
database.yml file similar to this:

adapter: sqlserver
mode: odbc


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs