on 07-28-2014 9:01 PM
I have jdbc code which talks to Sybase IQ. One of the thread is loading/update data into one Sybase IQ table say t1. Other threads will try to fire SQL query on table t1 after the first finished loading/updating data.
Write thread: Create table t1, load/update data into t1, commit to t1. Read thread(s): Read select query from t1
I am using JDBC and I am getting the following error as mentioned in here
Transaction 156593 attempted to access an object created by transaction 156608. -- (db_txnInfo.cxx 690) Sybase error code=21, SQLState=”QDA11”
I am not sure where is the problem I am commiting after every load. Every thread uses different connection read thread fires only select query then where is the problem how do I debug? Please guide. I am new to Sybase IQ and JDBC. Thanks in advance.
IQ only writes one writer, you do need to finish one transaction commit and then start another transaction, If you are on IQ 16, then you can set 'Blocking' option
When BLOCKING is off, a transaction receives an error when it attempts a write operation and is blocked
by the read lock of another transaction.
When BLOCKING is on, any transaction attempting to obtain a lock that conflicts with an existing lock
held by another transaction waits until every conflicting lock is released or
until the blocking_timeout is reached. If the lock is not released within
blocking_timeout milliseconds, then an error is returned for the waiting transaction.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sarorj thanks a lot for the reply. I am committing first transaction before starting another transaction and new transaction are just read/select query on the same table even jdbc connection is also different. Even I am putting Thread.sleep when first transaction completes so that it wont affect other transactions. Not able to understand why its a problem.
In addition to above replies, I would suggest that you explicitly commit in the second session prior to running its statement.
The second transaction should have a new transaction id(higher number than the one of the first transaction) in order to access the table which was already modified by the first transaction.
Jerry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You may have uncommited select statement on the same session!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.