Recent

Author Topic: SQLite  (Read 9287 times)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: SQLite
« Reply #15 on: November 24, 2011, 04:04:22 pm »
Without much experience I can theorize with the best of them. Is there any chance that those database close and open operations are asynchronous - if the loop is tight the close might not have finished and the db can't be opened again?

And have I understood correctly that you've isolated problem completely to the sqlite part - no mysql involvement?

This must be immensely frustrating.

I'd suggest writing up a minimal test case that shows the same behaviour if you have the time - you can submit it here & get it checked by people like Ludo and/or upload it to the bug tracker.

Alternatively, you might switch from sqlite to Firebird embedded. Works well on Windows for me (small scale though), might work well on Linux as well.

Good luck!
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: SQLite
« Reply #16 on: November 24, 2011, 04:19:07 pm »
Quote
And have I understood correctly that you've isolated problem completely to the sqlite part - no mysql involvement?
From what I gather the crash in sqlite only occurs when (re-)opening the mysql connection. Reason why mysql threading is high on my suspect list. A wrong pointer type of issue.

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: SQLite
« Reply #17 on: November 24, 2011, 05:17:19 pm »
I also notices that procedure InitialMove and  function MoveToHeadend are declared public. InitialMove isn't called at all in the unit headend_upload. Are they called from another thread?

iwilson

  • New Member
  • *
  • Posts: 44
Re: SQLite
« Reply #18 on: November 24, 2011, 08:12:27 pm »
Pretty busy at work and this bug kept me behind so I've had to move on to the rest currently and use this temporary fix, however I will bring the project home tonight and hash it out as BigChimp suggested. I want to get to the bottom of this and if it's a bug then so be it.

InitialMove is the only one to be public, MoveToHeadend is only run internally in the thread... As I said, the code is a bit of a preliminary draft mess.

Appreciate all the support on these forums very much :)

 

TinyPortal © 2005-2018