- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我在使用 SqlJet Transactions 时尝试访问我的数据库,但我一直收到此错误
org.tmatesoft.sqljet.core.SqlJetException: MISUSE: error code is MISUSE
这是我的代码:
SqlJetDb db = null;
try {
File dbFile = new File(Configuration.DATABASE_NAME);
db = SqlJetDb.open(dbFile, true);
db.getOptions().setAutovacuum(true);
db.beginTransaction(SqlJetTransactionMode.READ_ONLY);
ISqlJetTable table = db.getTable("customers");
ISqlJetCursor cursor = table.order(table.getPrimaryKeyIndexName());
if (!cursor.eof()) {
do {
getInitData(cursor);
} while (cursor.next());
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
db.commit();
} catch (Exception e) {
e.printStackTrace();
}
}
有人知道这个问题有什么问题吗?由于这个列表,实际库的使用是不正确的,但我已经检查过了,对我来说没有任何问题。 http://grepcode.com/file/repo1.maven.org/maven2/org.tmatesoft.sqljet/sqljet/1.0.2/org/tmatesoft/sqljet/core/SqlJetErrorCode.java#SqlJetErrorCode
谢谢!
最佳答案
发生这种情况是因为您试图打开一个已经被另一个进程打开的数据库。它发生在我身上是因为数据库是由 Firefox SQLite Manager 打开的,但基本上它可能由访问您的数据库的任何其他线程或进程发生。
关于java - SqlJet 事务误用错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14834565/
我想我在 SQLJet 数据库中插入记录时遇到了一个奇怪的错误。我打开数据库连接并使用以下代码插入测试记录。 ISqlJetTable tbl = db.getTable("file"); tbl.i
我在使用 SqlJet Transactions 时尝试访问我的数据库,但我一直收到此错误 org.tmatesoft.sqljet.core.SqlJetException: MISUSE: err
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,因为
我正在运行关于 svn 的 java 代码,它是这样的 http://code.google.com/p/justcodingforfun/source/browse/MagicMissile/src
我试图将 SVN 项目 放到我的本地目录中。但是我遇到了异常。 Exception in thread "main" java.lang.NoClassDefFoundError: org/tmate
我是一名优秀的程序员,十分优秀!