This is a migrated thread and some comments may be shown as answers.

Getting up-to-date data on multi-tread app.

1 Answer 14 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Paulhenri
Top achievements
Rank 1
Paulhenri asked on 06 May 2014, 03:28 PM
Hi!

I'm working on a muti-thread app, using the one-context-per-thread philosophy. I'm having troubles to load data that are up to date when it has been modified by another thread.

(so far, to workaround this issue I was instanciating a new context, but now and then it is throwing me a “SqlConnection does not support parallel transactions” exception)

Is there a way to force my context to load "fresh" data from the database?

Thanks!

Paul-Henri

1 Answer, 1 is accepted

Sort by
0
Ady
Telerik team
answered on 09 May 2014, 11:40 AM
Hello Paulhenri,

 Creating a new context instance should work. Querying with a new context should query the database (unless you have turned on the Level 2 cache). The exception indicates that somehow the same underlying connection is being used from different threads to start a transaction. It seems that the same context is being used from multiple threads.
Can you send me some sample code that demonstrates your scenario?
Alternatively you can turn off the OpenAccess connection pool and use the ADO.NET connection pooling by setting the 'BackendConfiguration.ConnectionPool.Pool' property value to 'ADO'.


Regards,
Ady
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
Tags
General Discussions
Asked by
Paulhenri
Top achievements
Rank 1
Answers by
Ady
Telerik team
Share this question
or