zbigj

How to turn off Firebird exception msg (deadlock message)?

8 posts in this topic

I simultanously run some threads and from time to time I have a message, that there is concurrent deadlock exception (update conflict with concurrent update). I know, that it sometimes happens, but is it possible to somehow turn off displaying messaging from Firebird? Or better somehow handle this exceptions ? 

Share this post


Link to post
Share on other sites



OK, sorry, maybe my  text is too compressed. I use Firebird as a database in my AutoIt application with "fbdll4vb20.dll". SQL works pretty well, I can UPDATE, INSERT, SELECT etc. from a database using Firebird.au3 UDF. It works perfectly but from time to time I have a message as I mentioned in my first post. The bad news is that the whole application stops and waits until I pressed OK. So, is there any Firebird AND AutoIt user who knows how to turn it off?

I read something about ObjEvent and handling errors but I gave up trying use it with Firebird DLL. Any help? 

Share this post


Link to post
Share on other sites

OK, sorry, maybe my  text is too compressed. I use Firebird as a database in my AutoIt application with "fbdll4vb20.dll". SQL works pretty well, I can UPDATE, INSERT, SELECT etc. from a database using Firebird.au3 UDF. It works perfectly but from time to time I have a message as I mentioned in my first post. The bad news is that the whole application stops and waits until I pressed OK. So, is there any Firebird AND AutoIt user who knows how to turn it off?

I read something about ObjEvent and handling errors but I gave up trying use it with Firebird DLL. Any help? 

 

How about posting your code (or a working reproducer if sensitive), so we can see what you're doing? Also, not being familiar with firebird personally, is the message a windows form that you could get info from with the Window Info Tool (a screenshot would be nice)? If so, perhaps post the information about the message window.


When you're dead, you don't know you're dead - it's only difficult for those that know you. It's the same way when you're stupid...

My Scripts: SCCM UDFInclude Source with Compiled Script, Windows Firewall UDF

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Here is beginnig of my  code:

#include "firebird.au3"
...

if _FireBird_ExecuteSelect($h_fbDll, "select p.semaphore from  people p where (p.semaphore is not null) and (p.id_people=" & $id & ")", $result)=0 then ; nobody set sempahore for this person yet

    $sttmt='update people p set p.semaphore=1 where p.id_people=" & $id ; try to reserve this person

   _FireBird_ExecuteStatement($h_fbDll, $sttmt))

endif

 

I run simultanously about 10 or 15 times a program, which have this piece of code. It reserves the person with given $id. First I check if any other program reserved this person. If not I try to set semaphore to 1. But from time to time I have the warning message which should be closed before program can continue.

post-59880-0-39372800-1399928053_thumb.j

As I read, this happens when transaction tries to update or delete a record that some other transaction updated or deleted. This is a normal event in database world and application should be ready to deal with it. My application is ready, but how to make this message invisible and inactive? I didn't start a transaction, firebird does it itself with each statement.

BR.

post-59880-0-39372800-1399928053_thumb.j

Edited by zbigj

Share this post


Link to post
Share on other sites

this thread is now a year old... I am guessing what you are looking at is a MsgBox in the FireBird.au3 UDF.  I suggest you go looking for that error loop and add a time-out to the MsgBox - then it should go away by itself eventually...


Skysnake

Why is the snake in the sky?

Share this post


Link to post
Share on other sites

Thanks Skysnake, it has worked :) 

Share this post


Link to post
Share on other sites

:)

I have since played a bit with Firebird.  I just guess that what you are seeing is a WAL file related problem.  Try to issue a "Commit;" at the end of your query.  If you cannot see your changes AND you keep on getting this kind of message it may mean that your instruction is sitting in the WAL file, waiting for the Commit to finalize.

Hope I explained that clearly. :)

 


Skysnake

Why is the snake in the sky?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • Chocolade
      By Chocolade
      I'm using csharp with the autoitx3.
      I added to my project referenced the autoit dll's. Everything was working find until I got exception say:
      "Unable to load DLL 'AutoItX3_x64.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"
      And I downloaded and installed the autoit and added the dll files referenced them to my project also the file name:
      AutoitX3_x64.dll but for some reason I don't see this dll file in the project tried to add it as reference few times and in the References I see only two files of Autoit: AutoItX3.Assembly.dll and Interop.AutoItX3Lib.dll but for some reason it's not adding the AutoitX3_x64.dll as reference.
       
      How should I add then the AutoitX3_x64.dll to my project ? I keep getting the exception message that it's missing.
       
    • GarnetDagger
      By GarnetDagger
      I would love to have some help or guidance 
      I am able to Query from my database but I am not able to Update or insert etc because I lack the knowledge for it
       
      this is my code for to retrieve some data from and works perfect
       
      Dim $ueberschriften = "" Dim $anzahl = 0 Dim $dsncount = 1 Global $DSN = "MTXXV5" Global $Query = "Select * from VIEWS" Func SSSQL($SSQuery) ;SuperSonicSQL     ConsoleWrite($SSQuery & @LF)     $cmboVal = ""     $adoCon = ObjCreate("ADODB.Connection")     $adoCon.Open($DSN)     $adoRs = ObjCreate("ADODB.Recordset")     $adoSQL = $SSQuery     $adoRs.CursorType = 2     $adoRs.LockType = 3     $adoRs.Open($adoSQL, $adoCon)     With $adoRs         Global $QueryAnswer = .GetRows     EndWith     Return $QueryAnswer EndFunc   ;==>SSSQL and this is my failed attempt, The Query is correct but I want to able to use it in autoit instead of have to manual update or insert into flamerobin
       
      $SS_SQL_Insert_or_Update = "INSERT INTO DETECTION (DNAME,DTYPE,WINNAME,AREA,COLOR,MOUSE) VALUES ('PopUpTradeInviteYes        s                    ','SEARCH','XXX','175,240,550,240,65,228,82,234','5062478','0') " Func SSSQLIU($SS_SQL_Insert_or_Update) ;SuperSonicSQL :P     $cmboVal = ""     $adoCon = ObjCreate("ADODB.Connection")     $adoCon.Open($DSN)     $adoRs = ObjCreate("ADODB.Record")     $adoSQL =$SS_SQL_Insert_or_Update ;~     $adoRs.CursorType = 2     $adoRs.LockType = 4     $adoRs.Open($adoSQL, $adoCon) ;~     With $adoRs ;~         Global $QueryAnswer = .GetRows ;~     EndWith ;~     Return $QueryAnswer EndFunc   ;==>SSSQL I am at a total loss and I am just trying this at random but I am also going to sleep now
      I would love to have some minor examples
      "C:\_CC_V10_DetectionTAB.au3" (174) : ==> The requested action with this object has failed.:
      $adoRs.Open($adoSQL, $adoCon)
      $adoRs^ ERROR
    • mjolnirmarkiv
      By mjolnirmarkiv
      Hi,
      I'm trying to connect to Firebird database via AutoIt. Something that was supposed to be a cakewalk so far ended with no succes, as usual hoping for your help.
      I'm using the following Firebird Direct Access for Visual Basic DLL: http://sourceforge.net/projects/fbdll4vb/files/. And the code below comes from Stephen Podhajecki (Eltorro) Firebird UDF (only parts I need at the moment):
      The code above gives me this:

      The specific kind of server\database I need to connect to is belong to following application if that matters: http://www.projetex.com/, it is using Firebird 2.5. While ODBC\123 comes from following settings in the Server Administrator utility:

      I've installed a VM with above mentioned application, server and databse running on it so I have admin rights to access it for testing. Nevertheless when I tried to use a gsec (a command prompt utility that comes with the app) to display a list of users it only gave me this:
      gsec -user Admin -password admin -database "C:\Program Files\AIT\Projetex 9\Projetex Server\Database\Projetex.fdb" -display
      use gsec -? to get help
      Your user name and password are not defined. Ask your database administrator to setp up a Firebird login.
      unable to open database.
      So I changed it to ODBC, and there was some progress:
      gsec -user ODBC -password 123 -database "C:\Program Files\AIT\Projetex 9\Projetex Server\Database\Projetex.fdb" -display
      invalid request BLR at offset 37
      table USERS is not defined
      I tried to add a user mjolnir\123 and this time there was no progress:
      gsec -user ODBC -password 123 -database "C:\Program Files\AIT\Projetex 9\Projetex Server\Database\Projetex.fdb" -add mjolnir -pw 123
      An error occured while attempting to add the user.
      invalid request BLR at offset 51
      table USERS is not defined
      It seems I'm not quite understand how the damn thing works. The Server Administrator utility have plenty of users including the admin, all of the have access to read the database and could do this via Projetex client, neither cann't do this nor via gsec, not programmaticlly via AutoIt code above. And then it says smth about "table USERS" which is not defined apparently, looks like database users is not the same thing as server users and I'm doing it wrong.
    • Skysnake
      By Skysnake
      Howdy, 
      In a bizarre twist of events a client installed McAfee Antivirus Plus (the paid version).  I have scripts running there, the simplest is a little HTTP downloader, which opens HTML pages and downloads some files.  These scripts have been running for years.  The new AV kills the process.  The process just "disappears" with no warning.
      I can not find an "exception" setting.  IT on site had to kill it in the Task Manager and restart the PC.  All other AV products (even the free ones) have an easily accessible Exception setting.
      Note that the standard McAfee that typically comes with Acrobat does not do this, yet.
      Any advice on this please? Other than "get a new AV"? This has been suggested and as they just dished out the cash, not a current option.
    • nevodj
      By nevodj
      Hello,

      I can't find anything helpful in the forums about querying a Firebird database.

      Does anyone know if this can be done and how?

      Thanks