Re: The twin problem (was Re: HELP - Index Locks are creating DEADLOCKS)
Posted in 1992
Oliver Okrongli writes: >In I-SE 4.0 the error number for "statement not available" was -515. >This changed to -554 in I-SE 4.1 whithout any obvious reason. Since >our code is designed to work with I-SE and I-OnLine whithout >recompilation one of the first things in database initialization is: > > $set isolation to dirty read; > if (!db_stmt_not_available()) > db_error("set isolation to dirty read"); > >To work with both releases the definition of db_stmt_not_available had >to be changed: > > #define db_stmt_not_available() (db_code() == -515 || db_code() == -554) Please allow me to offer you a (perhaps) better solution. If you check a 4.1 or better manual, you will find that following the database statement, the sqlca structure will contain a flag value indicating whether an SE or OnLine engine was started (it is one of the sqlwarn elements - it will also indicate logging/no logging and ansi/no ansi). If you check this then, you can easily set a global flag that can be checked for the very purpose of determining appropriate statements. Dave -- Disclaimer: These opinions are not those of Informix Software, Inc. ************************************************************************** "I look back with some satisfaction on what an idiot I was when I was 25, but when I do that, I'm assuming I'm no longer an idiot." - Andy Rooney