Print Page | Close Window

SQLite

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3298
Printed Date: 25-Apr-2024 at 7:51am


Topic: SQLite
Posted By: Sakar SR
Subject: SQLite
Date Posted: 24-Feb-2012 at 5:59am
Is SQLite DB fully supported in DF 2010 in .Net 4

When i ran this code it gave me this error.

public static SysUser GetUser(EntityManager pManager, string pUserName)
{
try
            {
                var mgr = new eFilerDBEntities(pManager,true);
                var aUser = mgr.SysUsers.Where(p => p.UserName == pUserName).FirstOrNullEntity();
                return aUser;
            }
 catch(Exception p)
            {
                throw p.InnerException;
 
            }          
           
        }

Throws this Error:

"The underlying provider failed on EnlistTransaction."

I using SQLite data base.








Replies:
Posted By: kimj
Date Posted: 24-Feb-2012 at 2:08pm
DevForce wraps queries in a TransactionScope by default, so this is probably causing the problem.  You can disable this behavior by modifying the TransactionSettings.Default singleton:
 
   TransactionSettings.Default = new TransactionSettings(System.Transactions.IsolationLevel.ReadCommitted, TimeSpan.FromSeconds(30), false);
 
It's the "false" parameter which disables the TransactionScope.
 
More about TransactionSettings - http://drc.ideablade.com/ApiDocumentation/webframe.html?IdeaBlade.EntityModel~IdeaBlade.EntityModel.TransactionSettings.html - http://drc.ideablade.com/ApiDocumentation/webframe.html?IdeaBlade.EntityModel~IdeaBlade.EntityModel.TransactionSettings.html .
 
 
 


Posted By: Sakar SR
Date Posted: 25-Feb-2012 at 1:13pm
Hi Kimj.

Thanks , i fixed it, and it is working.

Have a nice day.



Print Page | Close Window