ORA-01461: Can only bind long values to insert a long column

Source: Internet
Author: User
Tags aop bind commit sql error oracle database

The following error occurred while using hibernate to save data to the Oracle database:
?

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 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 JDBCExceptionRepo rter:101-ora-01461: Can only bind long values to insert long columns   19:52:35,156  WARN jdbcexceptionreporter:100-sql error:1461, S qlstate:72000 19:52:35,156 Error jdbcexceptionreporter:101-ora-01461: Can bind only Long value   19:52:35,156 error to insert long column Abstractflushingeventlistener:324-could not synchronize Database 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: Can only bind Long value    AT to insert long column 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)   More

Reason: One character Keben is varchar2 (1024), but the actual value to be inserted exceeds the maximum allowable length of 4000, Oracle automatically converts the field value to a long type, and then prompts the insert operation to fail.

Resolution: 1, is it true to insert a value that exceeds the defined length? Otherwise, the length of the judge, interception and so on.

2, if, then the field using CLOB, blob, or use the file instead, the field to save the file address can.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.