Hello, I get the following error when loading some Fixtures into the Test Database for a unit test. I''m using the Sql Server adapter. It seems like a AR is trying to call another query in the transaction without closing the first RecordSet. Has anybody had this issue and have a workaround? ActiveRecord::StatementInvalid: 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 @@IDENTITY AS Ident: INSERT INTO web_site_logins ([web_site_id], [account_id], [password], [login]) VALUES (''nanet'', ''2'', ''2nanet_password'', ''2nanet_id'') See http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q272/3/58.asp&NoWebContent=1 -- Thank you, Brian Takita http://freeopinion.org _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
I think found the error. I to make my id column a varchar that was set based on the web_site_id and account_id columns. My intention was to create a readable id column. Am I correct in saying that Rails only allows an integer for the id column? I think will refactor my design to have one table per website type, which would remove the need for the web_site_id column, allowing me to make the account_id the pk. On 10/24/05, Brian Takita <brian.takita-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hello, > > I get the following error when loading some Fixtures into the Test > Database for a unit test. > I''m using the Sql Server adapter. > > It seems like a AR is trying to call another query in the transaction > without closing the first RecordSet. Has anybody had this issue and have a > workaround? > > ActiveRecord::StatementInvalid: 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 @@IDENTITY AS Ident: INSERT INTO > web_site_logins ([web_site_id], [account_id], [password], [login]) VALUES > (''nanet'', ''2'', ''2nanet_password'', ''2nanet_id'') > > See http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q272/3/58.asp&NoWebContent=1 > > > > -- > Thank you, > Brian Takita > http://freeopinion.org-- Brian Takita http://freeopinion.org _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Oct 24, 2005, at 12:13 PM, Brian Takita wrote:> I think found the error. > I to make my id column a varchar that was set based on the > web_site_id and account_id columns. My intention was to create a > readable id column.Brian, this is a problem specific to the MSSQL database adapter: it breaks when you specify your own primary key. http:// dev.rubyonrails.org/ticket/2320 jeremy -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (Darwin) iD8DBQFDXTNKAQHALep9HFYRAsppAJkBruM2K8yNdd9+dbRkJuH+3ri2OACgzXLN M2eJPfs7cK/i2zpiZzzoXvM=/TcN -----END PGP SIGNATURE-----