SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Development Tools
 ASP.NET
 C#, Java and Access Locking
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Nexzus
Starting Member

13 Posts

Posted - 03/29/2013 :  01:02:38  Show Profile  Reply with Quote
Couldn't really find a best place to put this, so I ended up in this section.

So I've an Access 2007 database of TV listings that I fill by scraping and parsing a website every morning using a small C# executable - works fine.

Then I have a java program called PS3 Media Server where I've written an add-on to query the database to show what's on a particular network at that moment, and then do some voodoo to watch that particular show on my PS3 (a cheap-geek's program guide) - works fine.

Finally, I've written a C#/ASP.net website (W2K3/IIS6/.NET 2.0) that also queries the DB and displays some condensed data about TV shows on my Cisco IP phones (because I can, that's why). - works fine if the java program is not running. Otherwise, I get a nice

"Could not use 'd:\mdbdata\ShawTVListings.accdb'; file already in use"
error.

There's nothing fancy about the connection strings in either program, and it's interesting that my scraper/parser/inserter program works regardless the state of the java program. In fact, in both the java program and ASP.net page, I've explicitly set readonly

Java:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};
DBQ=d:/mdbdata/ShawTVListings.accdb;READONLY=true", "", "");


C#/ASP.net:
OleDbConnection.ConnectionString = string.Format(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};
Persist Security Info=False;", @"d:\mdbdata\ShawTVListings.accdb");


Thinking it was some slapfight of access rights between Administrator (the Java and scraper user instance) and Anonymous IIS User (what the ASP.net app runs under, even though it had write access to the database and its folder), I set my web app to run as Administrator (don't worry, it's not accessible from outside) - no difference.

Thoughts?

Edited by - Nexzus on 03/29/2013 01:18:18

chadmat
The Chadinator

USA
1974 Posts

Posted - 03/30/2013 :  01:24:44  Show Profile  Visit chadmat's Homepage  Reply with Quote
Why not use SQL Express?

-Chad
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000