Recent

Author Topic: deadlocks - firebird  (Read 2639 times)

3rdshiftcoder

  • New Member
  • *
  • Posts: 24
deadlocks - firebird
« on: September 20, 2015, 04:46:21 am »
Hi-

When you using data aware components, how do you handle deadlocks so they don't crash your application?
How do you tell your application to rollback? How would you handle the deadlock exception?  It would be like a run-time error...right?

I have been fooling with fb-isql and setting the different isolation levels and parameters to see how transactions work.

thanks for any ide or coding tip regarding this!

THANKS,
jim



3rdshiftcoder

  • New Member
  • *
  • Posts: 24
Re: deadlocks - firebird
« Reply #1 on: September 20, 2015, 05:05:28 am »
Hi-

For  a roll back it might be something like this i think. Does this look like the right way? -- Thx, jim

begin
   try
      db stuff
   except
      on dberror do
      begin
         a rollback statement;
      end;
   end;

3rdshiftcoder

  • New Member
  • *
  • Posts: 24
Re: deadlocks - firebird
« Reply #2 on: September 20, 2015, 06:29:30 am »
Hi-

I took off the auto commit and raised this exception EZSQLException. It is a deadlock.
Now I have to figure out how to rollback when I get this exception.
I just made a project tonight to test out the locking. I have been working in fb-isql before tonight.

thanks,
jim

3rdshiftcoder

  • New Member
  • *
  • Posts: 24
Re: deadlocks - firebird
« Reply #3 on: September 20, 2015, 08:12:21 am »
Hi-

I found this link: http://wiki.lazarus.freepascal.org/SQLdb_Tutorial2#SQLite.2C_PostgreSQL.2C_other_databases

I will have to do some reading tomorrow. I need to figure out how this code works if I am editing in a grid. I am too tired to read about it at the moment.

thanks to whomever posted this tutorial. I think it will be exactly what I need.

jim


3rdshiftcoder

  • New Member
  • *
  • Posts: 24
Re: deadlocks - firebird
« Reply #4 on: September 20, 2015, 08:16:25 pm »
HI-

It turns out because I am using Zeos that this is the  best link I found. This should take care of deadlocks I think.

http://forum.lazarus.freepascal.org/index.php?topic=12299.0

Thanks to the cool people who posted it!

Have a great rest of the weekend,
jim