|
| Sorry for the wordiness.
VC++ 8.0, XP Pro SP2, etc. We're porting from Borland C++
Builder/ADO to VC++/ODBC. This worked fine with BCB/ADO.
First, the rationale. We have a number of 'batch' (console) apps
that can not be run at the same time due to possible conflicts in
DB tables. The apps can be run on a number of different servers,
and they all access the same DB, so named semaphores were out.
We were using a DB table as a semaphore. The idea was to insert
a row in the table with the name of a table that should be
'logically' locked. The locked table name column name is unique.
We don't actually want to lock the table itself because other
read only programs should be able to use the table.
I'm sorry if that isn't crystal clear. Here's the problem. I
put together a test program in order to determine the problem.
Very simply,
- Set up the hEnv and hDbc stuff.
- Execute "SET LOCK_TIMEOUT 2000"
- Set SQL_AUTO_COMMIT_OFF
- Execute the INSERT statement
- Wait for keyboard input
Run the program. Fine. Run another instance and it 'hangs' on
the INSERT. Where's my timeout? The second instance won't "come
back" until the first instance terminates.
Thanks for any help,
- Arnie
|
|