6

My application generates sometimes this kind of errors when accessing Firebird database:

Unsuccessful execution caused by a system error that precludes successful execution of subsequent statements GDS Code: 335544726 - SQL Code: -902 - Error Code: 406'

What could be the problem? Is there any way to debug this?

I'm running Firebird 2.5.1 on Windows 7. There are at least kinterbasdb with Python and UIB components with Delphi in use.

Harriv
  • 6,029
  • 6
  • 44
  • 76
  • `335544726 -> isc_net_read_err -> "error reading data from the connection"` which suggests some kind of network error. – LightBulb Oct 18 '12 at 20:36
  • What messages firebird log file contains? Did you check your database file for curruption with gfix utility? When did you backup/restore your database last time? Why don't you upgrade Firebird to the latest 2.5.3 snapshot? – Andrej Kirejeŭ Oct 18 '12 at 20:36
  • @LightBulb Local applications, nothing goes thru network. – Harriv Oct 18 '12 at 20:46
  • @Harriv I'm not suggesting that it IS a network error, I've just provided description for the error code present in the error message. – LightBulb Oct 18 '12 at 20:51
  • @AndrejKirejeŭ Log file contains some "INET/inet_error: read errno = 10054" lines, but timestamps do not much application errors. I'll usually go with "official" releases, haven't paid too much attention for development releases. – Harriv Oct 18 '12 at 20:53
  • That error (10054 == connection reset by peer) indicates that you are using a network connection. Connecting to localhost is also using 'network', even if it is local to your machine. – Mark Rotteveel Oct 19 '12 at 07:50
  • 1
    Is your application multithreaded? If so, do threads share the same connection? – Andrej Kirejeŭ Oct 19 '12 at 08:52

2 Answers2

2

Looks like the reason for this was using same connection/transaction from multiple threads.

Harriv
  • 6,029
  • 6
  • 44
  • 76
1

After we have switched to UIB (from IBX) we had many errors like this too.
It is caused by the transaction kind (Option) of TUIBTransaction. Both:
"Read Commited": [tpNowait,tpReadCommitted,tpRecVersion] and
"Snapshot" : [tpConcurrency,tpNowait]
caused the same, because of "tpNowait". Especially after switched from normal HDDs to SSD. (Inserting sleep(2); between each line, line TR.Start; sleep(2); ... TR.Commit; helped a bit but did not fully solved. )

We did not want to use simply "tpWait" because it was too risky the APP may hang forever.

So the solution was to:
1.) Change transaction Option to "default". [tpConcurrency,tpWait,tpWrite]
2.) We set at runtime TR.LockTimeOut := 5; //seconds every each time before starting a transaction. (If failed because of the timeout, you may repeat the execution with higher value, while it is wise to inform the user about the frozen UI.)

IMPORTANT:
The current (2016) UIB code can not handle LockTimeOut at all. First it has to be fixed. See code here...

SzakiLaci
  • 347
  • 1
  • 16