Error Performing Query
-
- Posts: 10
- Joined: Mon 19 Mar 2012 18:41
Error Performing Query
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?
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?
-
- Posts: 10
- Joined: Mon 19 Mar 2012 18:41
Some more information
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.
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
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.
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.
-
- Posts: 10
- Joined: Mon 19 Mar 2012 18:41
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
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.
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.
-
- Posts: 10
- Joined: Mon 19 Mar 2012 18:41
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.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.
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