Metro - multiple connections

Metro - multiple connections

Postby dilbert » Fri 07 Dec 2012 14:14

I'm using LinqConnect for Metro with SQLite provider.
I'd like to know if it's possible to use multiple connections (e.g. for asynchronous operations)?
I found no way how to use them (either with DataContext or directly with SQLiteConnection).

This code:
Code: Select all
SQLiteConnection conn1 = new SQLiteConnection(ConnectionString);
conn1.Open();
SQLiteConnection conn2 = new SQLiteConnection(ConnectionString);
conn2.Open();

raises following exception when trying open second connection (conn2.Open()):
Code: Select all
Devart.Data.SQLite.SQLiteException:
  Message=Unable to open database file
  Source=Devart.Data.SQLite
  ErrorCode=0
  StackTrace:
       at   . ()
       at   ..ctor(    )
       at   .      (    , Object  , DbConnectionBase  )
       at   . (    ,     , DbConnectionBase  )
       at   . (    , DbConnectionBase  )
       at   . (DbConnectionBase  )
       at   . (DbConnectionBase  )
       at   . (DbConnectionBase  )
       at  .     (DbConnectionBase  )
       at Devart.Common.DbConnectionBase.Open()
       at Devart.Data.SQLite.SQLiteConnection.Open()


Here is my connection string:
Code: Select all
Data Source=ms-appdata:///local/database.db;Read Uncommitted=true;Busy Timeout=15000;Connection Timeout=60;Foreign Key Constraints=On;Pooling=True;Max Pool Size=100;
dilbert
 
Posts: 68
Joined: Tue 28 Apr 2009 10:11

Re: Metro - multiple connections

Postby MariiaI » Mon 10 Dec 2012 14:32

Yes, it is possible to use multiple connections. The code you have posted is correct.
As for the "Unable to open database file" exception, we have reproduced it. We will investigate it and inform you about the results as soon as possible.
MariiaI
Devart Team
 
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Metro - multiple connections

Postby dilbert » Fri 18 Jan 2013 09:45

I'd just like to ask if there is any progress with this issue.

Although, in most cases a single connection is enough, it is almost impossible in asynchronous operations. And in some other cases, like transactions, you have to close connection by yourself after a transaction is committed etc.
So, I'm now waiting just for stable release of LinqConnect for Metro to be able publish an application to Windows Store.

So, my question is if you have a plan for fixing this problem?
Thank you.
dilbert
 
Posts: 68
Joined: Tue 28 Apr 2009 10:11

Re: Metro - multiple connections

Postby MariiaI » Fri 18 Jan 2013 12:31

We are planning to release the next build of LinqConnect for Metro in several weeks. We are investigating this issue at the moment and we will inform you whether it will be fixed in the new build or not.
MariiaI
Devart Team
 
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Metro - multiple connections

Postby MariiaI » Mon 04 Feb 2013 09:42

We have fixed the issue related to the "Unable to open database file" exception when opening several connections in LinqConnect for Metro. The fix will be available in the next build of LinqConnect for Metro. We will inform when it is available for download.
MariiaI
Devart Team
 
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Metro - multiple connections

Postby MariiaI » Thu 07 Feb 2013 13:42

New build of LinqConnect for Metro 4.1.184 is available!
It can be downloaded from http://www.devart.com/linqconnect/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=31&t=25834.
MariiaI
Devart Team
 
Posts: 1472
Joined: Mon 13 Feb 2012 08:17


Return to LinqConnect (LINQ to SQL support)