Connection.getAutoCommit() unsupported???

04-11-19 lyy95052

hibernate2.16+dao+csv类型的数据库(就是以文件作为表的那种)

连接数据库的时候正常连接,但是在读取数据时出现错误:

如运行如下代码:

OrgChart orgChart = new OrgChart();

......

try

{

.... = orgChart.retreiveCompanies();//here the error occurs

}

.....

错误如下:

java.lang.UnsupportedOperationException: Connection.getAutoCommit() unsupported

at org.relique.jdbc.csv.CsvConnection.getAutoCommit(Unknown Source)

at net.sf.hibernate.connection.DriverManagerConnectionProvider.getConnection

(DriverManagerConnectionProvider.java:103)

at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:286)

at net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3326)

at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3286)

at net.sf.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:40)

at net.sf.hibernate.transaction.JDBCTransactionFactory.beginTransaction

(JDBCTransactionFactory.java:19)

at net.sf.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:2231)

at common.util.ThreadedSession.put(ThreadedSession.java:56)

at common.hibernate.base._RootDAO.createSession(_RootDAO.java:198)

at common.hibernate.base._RootDAO.createSession(_RootDAO.java:189)

at common.hibernate.base._BaseRootDAO.getSession(_BaseRootDAO.java:114)

at common.hibernate.base._BaseRootDAO.find(_BaseRootDAO.java:197)

at organization.dao.OrgChartDAO.retrieveCompanies(OrgChartDAO.java:321)

at common.hibernate.test.OrgChartDAOTest.testRetrieveCompanies(OrgChartDAOTest.java:384)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

...................

百思不得其解,望高手指点!(这个问题已经折腾我两个星期了!!),先谢了!

banq
2004-11-22 19:11

Connection.getAutoCommit() unsupported

csv类型的数据库不支持事务。