NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 38 39 40 41 42 … 93 Next »
Database locked exception

 
  • 0 Vote(s) - 0 Average
Database locked exception
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#1
2007-10-20, 07:04 PM
I know accessing the gbpvr DB directly isn't approved but I've got a slightly confusing error.

I can create a DataAdapter and Dataset with VS dataset designer and execute the query I want without any problems. When I try to do it within a plugin (in PVRX2), I get this in the log file...

Code:
2007-10-20 18:41:54.157    VERBOSE    [1]    System.Data.SQLite.SQLiteException: The database file is locked
Unable to close due to unfinalised statements
   at System.Data.SQLite.SQLiteConnectionHandle.ReleaseHandle()
   at System.Runtime.InteropServices.CriticalHandle.Cleanup()
   at System.Runtime.InteropServices.CriticalHandle.Dispose(Boolean disposing)
   at System.Runtime.InteropServices.CriticalHandle.Dispose()
   at System.Data.SQLite.SQLite3.Close()
   at System.Data.SQLite.SQLiteConnection.Close()
   at System.Data.Common.DbDataAdapter.QuietClose(IDbConnection connection, ConnectionState originalState)
   at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
   at DVB_T_Radio.CapSourcesTableAdapters.BDA_RECORDING_SOURCETableAdapter.Fill(BDA_RECORDING_SOURCEDataTable dataTable) in C:\Documents and Settings\gbpvr\My Documents\Visual Studio 2005\Projects\DVB-T Radio\CapSources.Designer.cs:line 636
   at DVBTRadio.DVBTRadio.Activate() in C:\Documents and Settings\gbpvr\My Documents\Visual Studio 2005\Projects\DVB-T Radio\DVB-T Radio.cs:line 26

Why does it work in VS but not in PVRX2?

Cheers,
Brian
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#2
2007-10-20, 07:09 PM
I've never really used the DataAdapter and Dataset classes, so cant provide you any insights into this. It sounds like its doing a select but then not reading the data so the database is left in a locked state.

BTW, there is a bug in PVRX2 that can cause Activate() to be called twice on a plugin, which may have some bearing on this...
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#3
2007-10-20, 07:21 PM
sub Wrote:BTW, there is a bug in PVRX2 that can cause Activate() to be called twice on a plugin, which may have some bearing on this...
OK - thanks I'll move the DB code to a separate method to test it out.

Cheers,
Brian
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#4
2007-10-20, 09:24 PM
Well I can confirm that it's not that Activate() is called twice. I moved the datatable/tableadapter code into a method invoked by a test button and got the same exception.

I then tried 'old school' SQLite connection, command and datareader but still had the same problem.

The plugin has an associated external console app. so I tried to add a datatable and adapter to that - VS let me but I couldn't work out how to reference it. :confused:

Finally I tried 'old school' coding in the console app. and it works perfectly.

I'll give up programming one of these days - nuthin's ever simple. Sad

Cheers,
Brian
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Delete recordings from database but not from disk? spinnaker 8 3,744 2013-10-26, 10:51 PM
Last Post: spinnaker
  trying to fake npvr database for unit tests reven 3 2,236 2013-05-20, 08:53 AM
Last Post: reven
  Puzzling exception bgowland 2 1,672 2012-03-07, 02:30 AM
Last Post: bgowland
  Merged database queries mvallevand 4 2,050 2011-06-26, 09:56 PM
Last Post: mvallevand
  NPVR database questions mvallevand 25 9,776 2011-01-06, 12:58 AM
Last Post: jksmurf
  NPVR database - why so stringy with the fields?? :0) carpeVideo 4 1,984 2010-09-21, 01:48 AM
Last Post: sub
  NPVR Database connection ralphy 4 2,427 2010-09-15, 12:09 AM
Last Post: sub
  How can I reset the Music plugin's database? mkenyon2 1 1,880 2009-10-15, 06:43 PM
Last Post: psycik
  SheduleRecording() locks database cb123 3 2,474 2009-02-14, 06:33 PM
Last Post: sub
  PlayAudioFile() throws exception bgowland 2 1,547 2008-10-09, 10:37 PM
Last Post: bgowland

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode