简体   繁体   English

事务 X 试图通过 JDBC 访问事务 Y 创建的对象

[英]Transaction X attempted to access an object created by transaction Y via JDBC

I have JDBC code which talks to Sybase IQ.我有与 Sybase IQ 对话的 JDBC 代码。 One of the thread is loading/update data into one Sybase IQ table say t1.其中一个线程正在将数据加载/更新到一个 Sybase IQ 表中,例如 t1。 Other threads will try to fire SQL query on table t1 after the first finished loading/updating data.在第一次完成加载/更新数据后,其他线程将尝试在表 t1 上触发 SQL 查询。

Write thread:
Create table t1, load/update data into t1, commit to t1.

Read thread(s):
Read select query from t1

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 committing after every load.我不确定每次加载后我遇到的问题在哪里。 Every thread uses different connection read thread fires only select query then where is the problem how do I debug?每个线程使用不同的连接读取线程只触发select查询那么问题出在哪里我该如何调试? I am new to Sybase IQ and JDBC.我是 Sybase IQ 和 JDBC 的新手。

You may need to issue a commit in the second thread.您可能需要在第二个线程中发出提交。 Or for the read-only thread set auto-commit on.或者为只读线程设置自动提交。

I'm curious, does the error happen on the first select from the second thread, or does it only happen after the first select?我很好奇,错误是发生在第二个线程的第一次选择上,还是只发生第一次选择之后?

In IQ, even a select statement can generate a transaction (which it should really handle a bit better as IQ is supposed to create "snapshot versions" to give a transaction a logitudinally consistent view on the data for the life of a transaction ... IQ has some F$%@#$%ng ugly warts by the way)在 IQ 中,即使是一个 select 语句也可以生成一个事务(它应该处理得更好一些,因为 IQ 应该创建“快照版本”以在事务的生命周期内为事务提供对数据的对数一致的视图......顺便说一下,智商有一些 F$%@#$%ng 丑陋的疣)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM