Groups | Blog | Home
all groups > dotnet ado.net > january 2007 >

dotnet ado.net : Any way to disable "lazy write" in Jet through ADO.NET?


DennisWelu NO[at]SPAM cartegraph.com
1/27/2007 8:55:44 PM
I don't think there is a way. There seems to be a black hole of info
about this unless you are using the older ADO technology.

If you know, please share...!

Dennis
DennisWelu NO[at]SPAM cartegraph.com
1/28/2007 7:32:01 AM
[quoted text, click to view]

That's funny. I get asked that question a lot.

An MDB (Access/Jet) database exists for this project. We are using
ADO.NET to connect to it with the OleDbXXX family of classes. There
are a couple different scenarios where we encounter the problem. One
of the most common is in automated integration tests using a test
version of the database.

Pseudo-code for test fixture setup:

// Create connection object to the MDB and open it
// (Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\...
\Test.mdb;Persist Security Info=False)
// Create command object, CommandType = CommandType.Text
// Set the CommandText to an "INSERT INTO " statement of some sort
// ExecuteNonQuery
// System.Threading.Thread.Sleep(3000);

That Sleep is currently necessary to work around the problem. Without
it the tests will run but fail because they won't see the results of
the INSERT INTO.

I have learned that unlike ADO, in ADO.NET the only way to set
provider specific values is on the connection string. However, based
on http://support.microsoft.com/kb/318161 there no longer seems to be
a way to set the "Jet OLEDB:Flush Transaction Timeout" at all because
it cannot be used in the connection
string, only once a connection has been established.

William (Bill) Vaughn
1/28/2007 12:37:14 PM
Have you tried to use the JRO (Jet Replication Objects) library? I'm also
surprised you can't set this option in the ConnectionString... but then
again, I don't recommend using JET for any serious applications--now that
there are so many other viable alternatives.


--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

[quoted text, click to view]

Miha Markic [MVP C#]
1/28/2007 1:40:16 PM
There is no lazy write in ado.net.
What exactly are you doing and what's your problem.
--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

[quoted text, click to view]
William (Bill) Vaughn
1/28/2007 2:08:41 PM
Yes, I just think it's a waste sending good money after bad. It's kinda like
when someone makes a monumental mistake and spends the rest of their career
trying to put the broken eggs back together.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

[quoted text, click to view]

DennisWelu NO[at]SPAM cartegraph.com
1/28/2007 2:46:05 PM
On Jan 28, 4:08 pm, "William \(Bill\) Vaughn"
[quoted text, click to view]

I'm with you in spirit, Bill. But what if it's a legacy database that
is going to be written out over time? It's often a reality that it's
too costly to rewrite the database and the software components written
on it all at once.

In this particular case we probably could make the decision to switch
over what we have to a direct connect to Express/MDF. But the db is
intended for single-user use and the simplicity of Jet is actually
quite appealing. We will do that if we have to.

Thanks much, Miha and Bill, for sharing your knowledge and toughts.

Dennis
Miha Markic [MVP C#]
1/28/2007 7:52:42 PM

[quoted text, click to view]

:-)

It is a weird situation. There should be a way to set that propery even
though ado.net is disconnected (in fact I am not sure why does this matter).
I'll ask around if anybody knows how to set it.

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
Miha Markic [MVP C#]
1/28/2007 10:34:31 PM
Heya Bill,

[quoted text, click to view]

It is not that surprising since it can't be set within connection string but
later on, after a connection has been estabilished. But yes, I can't see a
valid reason for this behaviour either.

but then
[quoted text, click to view]

Totaly agree, but what if there are valid reasons to keep running JET...

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
William (Bill) Vaughn
1/29/2007 11:00:36 AM
So, SQL Express might be overkill for your job--but SQL Server Compact
Edition might be just the ticket. It's lighter than JET and faster. It does
not share the same security issues and is fairly mature in its
implementation. MS is putting significant resources behind it--even building
a new replication engine for it (it already has at least two). See my new
EBook at www.hitchhikerguides.net.


--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

[quoted text, click to view]

DennisWelu NO[at]SPAM cartegraph.com
1/29/2007 9:45:07 PM
Thanks Bill, good thought, I will check that out.
AddThis Social Bookmark Button