以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 Semantic Web(语义Web)/描述逻辑/本体 』  (http://bbs.xml.org.cn/list.asp?boardid=2)
----  sql server 2000,本体持久化:Exception in thread "main" com.hp.hpl.jena.db.RDFRDBException: Failed to lock database after 5 attempts.  (http://bbs.xml.org.cn/dispbbs.asp?boardid=2&rootid=&id=59181)


--  作者:bzbc
--  发布时间:2/26/2008 4:44:00 PM

--  sql server 2000,本体持久化:Exception in thread "main" com.hp.hpl.jena.db.RDFRDBException: Failed to lock database after 5 attempts.
数据库是连上去了,出现了下面的错误,望高手赐教,不胜感激:
exception in thread "main" com.hp.hpl.jena.db.RDFRDBException: Failed to lock database after 5 attempts.

Try later or else call DriverRDB.unlockDB() after ensuring
that no other Jena applications are using the database.
 at com.hp.hpl.jena.db.impl.DriverRDB.lockDB(DriverRDB.java:925)
 at com.hp.hpl.jena.db.impl.DriverRDB.getSystemSpecializedGraph(DriverRDB.java:296)
 at com.hp.hpl.jena.db.DBConnection.containsModel(DBConnection.java:227)
 at com.hp.hpl.jena.db.impl.GraphRDBMaker.hasGraph(GraphRDBMaker.java:144)
 at com.hp.hpl.jena.db.impl.GraphRDBMaker.createGraph(GraphRDBMaker.java:106)
 at com.hp.hpl.jena.rdf.model.impl.ModelMakerImpl.createModel(ModelMakerImpl.java:46)
 at jena.examples.ontology.persistentOntology.PersistentOntology.listClasses(PersistentOntology.java:79)
 at jena.examples.ontology.persistentOntology.Main.main(Main.java:128)


--  作者:jpz6311whu
--  发布时间:2/27/2008 10:58:00 PM

--  
Q: Why am I getting an exception on failure to lock or unlock the database?
A: The Jena2 storage subsystem uses a lock internally to implement a critical section for operations that modify the database structure (create/delete tables). The lock is implemented as a database table, i.e., if the table exists in the database, the lock is held. Normally, this lock should be transparent to applications. But if an application has an exception while in a critical section, the database may remain locked for subsequent applications. In this case, a user must manually unlock the database either by calling DriverRDB.unlockDB() or by deleting the table (Jena_Mutex) from the database.
--  作者:bzbc
--  发布时间:2/28/2008 11:30:00 AM

--  
Last but not the least, please allow me to avail myself of this opportunity to extend to you my heartfelt gratitude for your care and support. Thank you.
--  作者:bzbc
--  发布时间:2/29/2008 9:53:00 AM

--  
怎么calling DriverRDB.unlockDB()
--  作者:jpz6311whu
--  发布时间:2/29/2008 3:12:00 PM

--  
请把程序源代码贴出来看看
--  作者:bzbc
--  发布时间:3/3/2008 8:55:00 AM

--  
public ModelMaker getRDBMaker(String dbURL, String dbUser, String dbPw,
   String dbType, boolean cleanDB) {
  try {
   // Create database connection
   IDBConnection conn = new DBConnection(dbURL, dbUser, dbPw, dbType);

   // do we need to clean the database?
   if (cleanDB) {
    conn.cleanDB();
   }

   // Create a model maker object
   return ModelFactory.createModelRDBMaker(conn);
  } catch (Exception e) {
   e.printStackTrace();
   System.exit(1);
  }

  return null;
 }
我调试的是jena自带的一个例子(PersistentOntology),麻烦了!


--  作者:expressyang
--  发布时间:4/7/2010 10:52:00 AM

--  
楼主,你好。我也碰到了类似的问题。不知你解决了没?
--  作者:strongzlgzlg
--  发布时间:4/18/2012 9:03:00 PM

--  
楼主,你好 我最近也在搞这个 我想问下jena可以连sql 2000吗?如果可以的话那DBtype 怎么写?SQL2000还是SQL 2000或者别的?
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
62.500ms