您当前的位置: 首页 > 数据库教程 > Oracle教程 > ORA-01461:仅能绑定要插入LONG列的LONG值

ORA-01461:仅能绑定要插入LONG列的LONG值

作者:不详 来源:网络 发布时间: 2014-08-25 17:23 点击:
使用Hibernate保存数据到oracle数据库时出现如下错误: ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68

ORA-01461:仅能绑定要插入LONG列的LONG值

  使用Hibernate保存数据到oracle数据库时出现如下错误:

  ?

  

  

  

  

  

  

  

  


  1

  2

  3

  4

  5

  6

  7

  8

  9

  10

  11

  12

  13

  14

  15

  16

  17

  18

  19

  20

  21

  22

  23

  24

  25

  26

  27

  28

  29

  30

  31

  32

  33

  34

  35

  36

  37

  38

  39

  40

  41

  42

  43

  44

  45

  46

  47

  48

  49

  50

  51

  52

  53

  54

  55

  56

  57

  58

  59

  60

  61

  62

  63

  64

  65

  66

  67

  68

  69

  70

  71

  72

  73

  74

  


  19:52:35,156 WARN JDBCExceptionReporter:100 - SQL Error: 1461, SQLState: 72000

  19:52:35,156 ERROR JDBCExceptionReporter:101 - ORA-01461: 仅能绑定要插入 LONG 列的 LONG 值

  19:52:35,156 WARN JDBCExceptionReporter:100 - SQL Error: 1461, SQLState: 72000

  19:52:35,156 ERROR JDBCExceptionReporter:101 - ORA-01461: 仅能绑定要插入 LONG 列的 LONG 值

  19:52:35,156 ERROR AbstractFlushingEventListener:324 - Could not synchronize database state with session

  org.hibernate.QueryTimeoutException: Could not execute JDBC batch update

  at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:124)

  at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)

  at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)

  at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:262)

  at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:178)

  at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)

  at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)

  at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1206)

  at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:375)

  at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)

  at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:6

  56)

  at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformT

  ra

  nsactionManager.java:754)

  at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransact

  ionManager.java:723)

  at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(Transa

  cti

  onAspectSupport.java:393)

  at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120)

  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

  at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)

  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

  at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)

  at $Proxy45.queryObjectOut(Unknown Source)

  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:597)

  at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)

  at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)

  at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.invoke(AbstractJAXWSMethodInvoker.java:178)

  at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:68)

  at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75)

  at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)

  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

  at java.util.concurrent.FutureTask.run(FutureTask.java:138)

  at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)

  at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:107)

  at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)

  at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)

  at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:239)

  at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:248)

  at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:222)

  at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:153)

  at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:167)

  at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:286)

  at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:206)

  at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

  at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:262)

  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)

  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

  at java.lang.Thread.run(Thread.java:662)

  Caused by: java.sql.BatchUpdateException: ORA-01461: 仅能绑定要插入 LONG 列的 LONG 值

  at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:343)

  at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10656)

  at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)

  at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)

  at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)

  ... 55 more

  


  原因:某一个字段本为varchar2(1024),但是实际要插入的值超过varchar2允许的最大长度4000时,oracle自动将该字段值转化为Long类型,然后提示插入操作失败。

  解决:1、是不是真的要插入超过定义长度的值?否则对长度做判断,截取等。

  2、若是,则将字段采用clob、blob,或者使用文件代替,字段保存文件地址即可。
分享到:
本文"ORA-01461:仅能绑定要插入LONG列的LONG值"由远航站长收集整理而来,仅供大家学习与参考使用。更多网站制作教程尽在远航站长站。
顶一下
(0)
0%
踩一下
(0)
0%
[点击 次] [返回上一页] [打印]
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 密码: 验证码:
关于本站 - 联系我们 - 广告合作 - 网站声明 - 友情连接- 网站地图 - 站点地图 - 返回顶部
Copyright © 2007-2013 www.yhzhan.com(远航站长). All Rights Reserved .
远航站长:为中小站长提供最佳的学习与交流平台,提供网页制作与网站编程等各类网站制作教程.
官方QQ:445490277 网站群:26680406 网站备案号:豫ICP备07500620号-4