zlh218
2008-06-03 10:07
浏览 373
已采纳

hibernate操作clob出错

现在项目使用hibernate遇到了一个很棘手的问题,就是在操作clob字段的时候当长度超过1000的时候就会报错:
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Could not execute JDBC batch update; uncategorized SQLException for SQL [insert into DT_CONFIGINFO (OPERATETYPE, OBJECTTYPE, CLASSNAME, CONFIGTIME, ISCONFIRM, USERLABEL, OBJECTNAME, CONFIGINFO, CONFIRMTIME, UUID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; SQL state [72000]; error code [1483]; ORA-01483: DATE 或 NUMBER 绑定变量的长度无效
; nested exception is java.sql.BatchUpdateException: ORA-01483: DATE 或 NUMBER 绑定变量的长度无效

Caused by: java.sql.BatchUpdateException: ORA-01483: DATE 或 NUMBER 绑定变量的长度无效

at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:343)
at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10656)
at sun.reflect.GeneratedMethodAccessor325.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:100)
at org.logicalcobwebs.proxool.ProxyStatement.intercept(ProxyStatement.java:57)
at $java.sql.Statement$$EnhancerByProxool$$545ba5a8.executeBatch()
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:237)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.springframework.orm.hibernate3.HibernateAccessor.flushIfNecessary(HibernateAccessor.java:390)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:373)
at org.springframework.orm.hibernate3.HibernateTemplate.save(HibernateTemplate.java:632)
at com.metarnet.cms.conf.ConfigPersistentManagerImpl.saveConfigData(ConfigPersistentManagerImpl.java:48)
at com.metarnet.cms.conf.ManagedJobConfigSyncNewEMSImpl.start(ManagedJobConfigSyncNewEMSImpl.java:201)
at com.metarnet.cms.job.JobManagerImpl.runJob(JobManagerImpl.java:214)
at com.metarnet.cms.job.QuartzJob.execute(QuartzJob.java:16)
at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
我使用数据库驱动是最新的,ojdbc14 10.2.0.1.0和10.2.0.4.0都用过,hbm.xml文件里是这样映射的
name="Configinfo"
column="CONFIGINFO"
type="text"
not-null="false"
/>
我还尝试加上length="10000"但是无济于事。不知道到底是什么原因

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

5条回答 默认 最新

相关推荐 更多相似问题