Error Performing Query

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for SQLite
Post Reply
pdc yaharasoftware
Posts: 10
Joined: Mon 19 Mar 2012 18:41

Error Performing Query

Post by pdc yaharasoftware » Tue 27 Mar 2012 15:02

DataContext in Library, defined in a service contract and implemented in a self hosted WCF Service, running under Mono:

public IEnumerable GetBEDCOLORTYPEList()
{
using (MainContext.MainDataContext cx = new MainContext.MainDataContext(GetPath()))
{
IEnumerable result = (from s in cx.BEDCOLORTYPEs select s).ToList();
return result;
}
}

[ERROR] FATAL UNHANDLED EXCEPTION: Devart.Data.Linq.LinqCommandExecutionException: Error on opening DbConnection. ---> System.NotImplementedException: The requested feature is not implemented.
at Devart.Common.DbConnectionInternal.a (System.Transactions.Transaction A_0, Devart.Common.y A_1) [0x00000] in :0
at Devart.Common.DbConnectionInternal.EnlistToDistributedTransactionInternal (System.Transactions.Transaction transaction) [0x00000] in :0
at Devart.Common.DbConnectionInternal.EnlistToDistributedTransaction (System.Transactions.Transaction transaction) [0x00000] in :0
at Devart.Common.DbConnectionInternal.a () [0x00000] in :0
at Devart.Data.SQLite.ac.a () [0x00000] in :0
at Devart.Common.DbConnectionInternal.w () [0x00000] in :0
at Devart.Common.DbConnectionFactory.b (Devart.Common.DbConnectionBase A_0) [0x00000] in :0
--- End of inner exception stack trace ---

This query works executed directly from an EXE. I have not tried it from a library although a coworker has tested that and indicated it works.

Thoughts?

pdc yaharasoftware
Posts: 10
Joined: Mon 19 Mar 2012 18:41

Some more information

Post by pdc yaharasoftware » Wed 28 Mar 2012 20:30

We switched to a paid version (bought the site license) and after running the Tools>License Information... which says I am good to go, I still get the error.

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Thu 29 Mar 2012 12:05

Could you please describe the scenario in more details? For example, do you explicitly open local and/or distributed transactions when retrieving data from the data context?

If possible, please send us a small sample with which the issue can be reproduced, so that we are able to analyze it in more details.

pdc yaharasoftware
Posts: 10
Joined: Mon 19 Mar 2012 18:41

Post by pdc yaharasoftware » Thu 29 Mar 2012 12:58

Sample project sent.

pdc yaharasoftware
Posts: 10
Joined: Mon 19 Mar 2012 18:41

Post by pdc yaharasoftware » Tue 03 Apr 2012 12:55

Any progress with my sample? Were you able to recreate the issue? Feedback is appreciated, if not expected.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Post by MariiaI » Wed 04 Apr 2012 07:58

Thank you for the sample project. We are investigating it now. We will notify you about the results as soon as possible.

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Mon 09 Apr 2012 11:46

We couldn't reproduce the issue in our environment. According to the stack trace, the problem occurs when trying to enlist the context connection to the distributed transaction. E.g., this may happen if you create a TransactionScope instance before using the context.

In either case, you can avoid such situations by changing the default connection behaviour (by default, a connection is always enlisted in the current distributed transaction). To do so, please set the 'Enlist' connection string parameter to false. Please tell us if this helps.

pdc yaharasoftware
Posts: 10
Joined: Mon 19 Mar 2012 18:41

Post by pdc yaharasoftware » Mon 09 Apr 2012 13:04

In either case, you can avoid such situations by changing the default connection behaviour (by default, a connection is always enlisted in the current distributed transaction). To do so, please set the 'Enlist' connection string parameter to false. Please tell us if this helps.
In my case I was not explicitly using a transaction scope but it is possible that the WCF framework defaults to enlisting, although I do not know how it would be involved in that portion of the test.

At any rate, setting Enlist=false in the connection string resolved the issue; this works for me as Mono does not currently support it anyway (per the error.)

Thank you very much for your help!

Patrick

Post Reply