Return-Path: Delivered-To: apmail-incubator-ibatis-user-java-archive@www.apache.org Received: (qmail 53919 invoked from network); 9 Jun 2005 18:03:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Jun 2005 18:03:22 -0000 Received: (qmail 57938 invoked by uid 500); 9 Jun 2005 18:03:20 -0000 Delivered-To: apmail-incubator-ibatis-user-java-archive@incubator.apache.org Received: (qmail 57832 invoked by uid 500); 9 Jun 2005 18:03:19 -0000 Mailing-List: contact ibatis-user-java-help@incubator.apache.org; run by ezmlm Precedence: bulk Reply-To: ibatis-user-java@incubator.apache.org List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list ibatis-user-java@incubator.apache.org Received: (qmail 57802 invoked by uid 99); 9 Jun 2005 18:03:18 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from brmea-mail-3.Sun.COM (HELO brmea-mail-3.sun.com) (192.18.98.34) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 09 Jun 2005 11:03:15 -0700 Received: from esunmail ([129.147.156.34]) by brmea-mail-3.sun.com (8.12.10/8.12.9) with ESMTP id j59I33w4023225 for ; Thu, 9 Jun 2005 12:03:03 -0600 (MDT) Received: from xpa-fe2 (esunmail [129.147.156.34]) by edgemail1.Central.Sun.COM (iPlanet Messaging Server 5.2 HotFix 2.02 (built Oct 21 2004)) with ESMTP id <0IHT00LVEWT2K9@edgemail1.Central.Sun.COM> for ibatis-user-java@incubator.apache.org; Thu, 09 Jun 2005 12:03:03 -0600 (MDT) Received: from [129.147.48.72] by mail.sun.net (iPlanet Messaging Server 5.2 HotFix 2.02 (built Oct 21 2004)) with ESMTPSA id <0IHT007OHWT0YZ@mail.sun.net> for ibatis-user-java@incubator.apache.org; Thu, 09 Jun 2005 12:03:01 -0600 (MDT) Date: Thu, 09 Jun 2005 12:03:23 -0600 From: Nathan Maves Subject: Re: 32k limitations for clob/blob? In-reply-to: <42A880BB.5010902@umich.edu> To: ibatis-user-java@incubator.apache.org Message-id: <521C1E0F-F1ED-4645-85CA-384D44348AF9@sun.com> MIME-version: 1.0 X-Mailer: Apple Mail (2.730) Content-type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-transfer-encoding: 7BIT References: <42A6FF29.5080107@ateikon.com> <2fe5ef5b05060807356540f7b6@mail.gmail.com> <2fe5ef5b05060807576ea0a9d3@mail.gmail.com> <2fe5ef5b05060808337d4d2e1@mail.gmail.com> <42A861EA.7070602@umich.edu> <2fe5ef5b05060909522ee0fbf7@mail.gmail.com> <42A876EE.6010108@umich.edu> <2fe5ef5b050609101560dc3f0a@mail.gmail.com> <42A880BB.5010902@umich.edu> X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Are you sure that your drivers are the most up-to-date available? http://opensource.atlassian.com/confluence/oss/display/IBATIS/How+do+I +use+a+Custom+Type+Handler+with+a+BLOB+or+CLOB%3F Check at the bottom of the page. Nathan On Jun 9, 2005, at 11:47 AM, Henry Lu wrote: > Could you send me an example of TypeHandlers in java? I only find > some code in .NET. > > -Henry > > Brandon Goodin wrote: > > >> I don't have any idea off the top of my head. This may be a good >> opportunity for you to do it with straight JDBC to see what works and >> then look at our TypeHandlers to see how they are translating. >> >> Brandon >> >> On 6/9/05, Henry Lu wrote: >> >> >>> No, I didn't. However, I got more details on the errors. >>> 1. If I insert into CLOB or LONG as jdbc type with String in >>> java, I got >>> the 32K limitation error. >>> >>> [java] size=1551138, 1551138 >>> [java] org.springframework.jdbc.UncategorizedSQLException: >>> (SqlMapClientTem >>> plate): encountered SQLException [ >>> [java] --- The error occurred in ibatis_map/AccessDB.xml. >>> [java] --- The error occurred while applying a parameter map. >>> [java] --- Check the insert_long-InlineParameterMap. >>> [java] --- Check the parameter mapping for the 'l' property. >>> [java] --- Cause: java.sql.SQLException: setString can only >>> process >>> strings >>> of less than 32766 chararacters]; nested exception is >>> com.ibatis.common.jdbc.ex >>> ception.NestedSQLException: >>> [java] --- The error occurred in ibatis_map/AccessDB.xml. >>> [java] --- The error occurred while applying a parameter map. >>> [java] --- Check the insert_long-InlineParameterMap. >>> [java] --- Check the parameter mapping for the 'l' property. >>> [java] --- Cause: java.sql.SQLException: setString can only >>> process >>> strings >>> of less than 32766 chararacters >>> >>> 2. If I insert into CLOB or LONG as jdbc type with byte[] in >>> java, I got >>> the following errors: >>> >>> [java] size=1461140, 1461140 >>> [java] org.springframework.jdbc.UncategorizedSQLException: >>> (SqlMapClientTem >>> plate): encountered SQLException [ >>> [java] --- The error occurred in ibatis_map/AccessDB.xml. >>> [java] --- The error occurred while applying a parameter map. >>> [java] --- Check the insert_long-InlineParameterMap. >>> [java] --- Check the statement (update failed). >>> [java] --- Cause: java.sql.SQLException: ORA-01461: can bind >>> a LONG >>> value o >>> nly for insert into a LONG column >>> [java] ]; nested exception is >>> com.ibatis.common.jdbc.exception.NestedSQLExc >>> eption: >>> [java] --- The error occurred in ibatis_map/AccessDB.xml. >>> [java] --- The error occurred while applying a parameter map. >>> [java] --- Check the insert_long-InlineParameterMap. >>> [java] --- Check the statement (update failed). >>> [java] --- Cause: java.sql.SQLException: ORA-01461: can bind >>> a LONG >>> value o >>> nly for insert into a LONG column >>> >>> Any idea? >>> >>> -Henry >>> >>> >>> Brandon Goodin wrote: >>> >>> >>> >>>> I'm not aware of this limitation. We have run into similar things >>>> before with the oracle driver. But, upgrading has always fixed it. >>>> Have you attempted a test using straight JDBC? >>>> >>>> Brandon >>>> >>>> On 6/9/05, Henry Lu wrote: >>>> >>>> >>>> >>>> >>>>> I got the following errors when I insert a large text into a >>>>> CLOB in >>>>> oracle by using iBatis. How do I resulve it? I am using Oracle >>>>> 10G jdbc >>>>> deiver. >>>>> >>>>> >>>>> org.springframework.jdbc.UncategorizedSQLException: >>>>> (SqlMapClientTemplate): encountered SQLException [ >>>>> --- The error occurred in >>>>> edu/umich/med/umms/tgsubmission/dao/ibatis_map/ >>>>> tgs_info_trainee.xml. >>>>> --- The error occurred while applying a parameter map. >>>>> --- Check the Tgs_info_trainee.insert_Tgs_info_trainee_map. >>>>> --- Check the parameter mapping for the 'INFO_TEXT' property. >>>>> --- Cause: java.sql.SQLException: setString can only process >>>>> strings of >>>>> less than 32766 chararacters]; nested exception is >>>>> com.ibatis.common.jdbc.exception.NestedSQLException: >>>>> --- The error occurred in >>>>> edu/umich/med/umms/tgsubmission/dao/ibatis_map/ >>>>> tgs_info_trainee.xml. >>>>> --- The error occurred while applying a parameter map. >>>>> --- Check the Tgs_info_trainee.insert_Tgs_info_trainee_map. >>>>> --- Check the parameter mapping for the 'INFO_TEXT' property. >>>>> --- Cause: java.sql.SQLException: setString can only process >>>>> strings of >>>>> less than 32766 chararacters >>>>> org.springframework.jdbc.UncategorizedSQLException: >>>>> (SqlMapClientTemplate): encountered SQLException [ >>>>> --- The error occurred in >>>>> edu/umich/med/umms/tgsubmission/dao/ibatis_map/ >>>>> tgs_info_trainee.xml. >>>>> --- The error occurred while applying a parameter map. >>>>> --- Check the Tgs_info_trainee.insert_Tgs_info_trainee_map. >>>>> --- Check the parameter mapping for the 'INFO_TEXT' property. >>>>> --- Cause: java.sql.SQLException: setString can only process >>>>> strings of >>>>> less than 32766 chararacters]; nested exception is >>>>> com.ibatis.common.jdbc.exception.NestedSQLException: >>>>> --- The error occurred in >>>>> edu/umich/med/umms/tgsubmission/dao/ibatis_map/ >>>>> tgs_info_trainee.xml. >>>>> --- The error occurred while applying a parameter map. >>>>> --- Check the Tgs_info_trainee.insert_Tgs_info_trainee_map. >>>>> --- Check the parameter mapping for the 'INFO_TEXT' property. >>>>> --- Cause: java.sql.SQLException: setString can only process >>>>> strings of >>>>> less than 32766 chararacters >>>>> com.ibatis.common.jdbc.exception.NestedSQLException: >>>>> --- The error occurred in >>>>> edu/umich/med/umms/tgsubmission/dao/ibatis_map/ >>>>> tgs_info_trainee.xml. >>>>> --- The error occurred while applying a parameter map. >>>>> --- Check the Tgs_info_trainee.insert_Tgs_info_trainee_map. >>>>> --- Check the parameter mapping for the 'INFO_TEXT' property. >>>>> --- Cause: java.sql.SQLException: setString can only process >>>>> strings of >>>>> less than 32766 chararacters >>>>> Caused by: java.sql.SQLException: setString can only process >>>>> strings of >>>>> less than 32766 chararacters >>>>> at >>>>> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.execut >>>>> eUpdate(GeneralStatement.java:87) >>>>> at >>>>> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.update >>>>> (SqlMapExecutorDelegate.java:500) >>>>> at >>>>> com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.update >>>>> (SqlMapSessionImpl.java:89) >>>>> at >>>>> org.springframework.orm.ibatis.SqlMapClientTemplate >>>>> $11.doInSqlMapClient(SqlMapClientTemplate.java:282) >>>>> at >>>>> org.springframework.orm.ibatis.SqlMapClientTemplate.execute >>>>> (SqlMapClientTemplate.java:140) >>>>> at >>>>> org.springframework.orm.ibatis.SqlMapClientTemplate.update >>>>> (SqlMapClientTemplate.java:280) >>>>> at >>>>> edu.umich.med.umms.tgsubmission.dao.sql.Tgs_info_traineeDaoSql.ins >>>>> ertTgs_info_trainee(Tgs_info_traineeDaoSql.java:67) >>>>> at >>>>> unit.edu.umich.med.umms.tgsubmission.dao.Tgs_info_traineeDaoSqlTes >>>>> tCase.doTestInsert(Tgs_info_traineeDaoSqlTestCase.java:100) >>>>> at >>>>> unit.edu.umich.med.umms.tgsubmission.dao.Tgs_info_traineeDaoSqlTes >>>>> tCase.testAll(Tgs_info_traineeDaoSqlTestCase.java:64) >>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) >>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown >>>>> Source) >>>>> at java.lang.reflect.Method.invoke(Unknown Source) >>>>> at junit.framework.TestCase.runTest(TestCase.java:154) >>>>> at junit.framework.TestCase.runBare(TestCase.java:127) >>>>> at junit.framework.TestResult$1.protect(TestResult.java:106) >>>>> at junit.framework.TestResult.runProtected(TestResult.java:124) >>>>> at junit.framework.TestResult.run(TestResult.java:109) >>>>> at junit.framework.TestCase.run(TestCase.java:118) >>>>> at junit.framework.TestSuite.runTest(TestSuite.java:208) >>>>> at junit.framework.TestSuite.run(TestSuite.java:203) >>>>> at >>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests >>>>> (RemoteTestRunner.java:474) >>>>> at >>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run >>>>> (RemoteTestRunner.java:342) >>>>> at >>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main >>>>> (RemoteTestRunner.java:194) >>>>> Caused by: java.sql.SQLException: setString can only process >>>>> strings of >>>>> less than 32766 chararacters >>>>> at >>>>> oracle.jdbc.driver.DatabaseError.throwSqlException >>>>> (DatabaseError.java:125) >>>>> at >>>>> oracle.jdbc.driver.DatabaseError.throwSqlException >>>>> (DatabaseError.java:162) >>>>> at >>>>> oracle.jdbc.driver.DatabaseError.throwSqlException >>>>> (DatabaseError.java:227) >>>>> at >>>>> oracle.jdbc.driver.OraclePreparedStatement.setStringInternal >>>>> (OraclePreparedStatement.java:4588) >>>>> at >>>>> oracle.jdbc.driver.OraclePreparedStatement.setString >>>>> (OraclePreparedStatement.java:4559) >>>>> at >>>>> com.ibatis.sqlmap.engine.type.ParameterSetterImpl.setString >>>>> (ParameterSetterImpl.java:139) >>>>> at >>>>> com.ibatis.sqlmap.engine.type.ClobTypeHandlerCallback.setParameter >>>>> (ClobTypeHandlerCallback.java:45) >>>>> at >>>>> com.ibatis.sqlmap.engine.type.CustomTypeHandler.setParameter >>>>> (CustomTypeHandler.java:46) >>>>> at >>>>> com.ibatis.sqlmap.engine.mapping.parameter.BasicParameterMap.setPa >>>>> rameter(BasicParameterMap.java:165) >>>>> at >>>>> com.ibatis.sqlmap.engine.mapping.parameter.BasicParameterMap.setPa >>>>> rameters(BasicParameterMap.java:125) >>>>> at >>>>> com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate >>>>> (SqlExecutor.java:80) >>>>> at >>>>> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExe >>>>> cuteUpdate(GeneralStatement.java:196) >>>>> at >>>>> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.execut >>>>> eUpdate(GeneralStatement.java:74) >>>>> ... 23 more >>>>> >>>>> Caused by: >>>>> java.sql.SQLException: setString can only process strings of >>>>> less than >>>>> 32766 chararacters >>>>> at >>>>> oracle.jdbc.driver.DatabaseError.throwSqlException >>>>> (DatabaseError.java:125) >>>>> at >>>>> oracle.jdbc.driver.DatabaseError.throwSqlException >>>>> (DatabaseError.java:162) >>>>> at >>>>> oracle.jdbc.driver.DatabaseError.throwSqlException >>>>> (DatabaseError.java:227) >>>>> at >>>>> oracle.jdbc.driver.OraclePreparedStatement.setStringInternal >>>>> (OraclePreparedStatement.java:4588) >>>>> at >>>>> oracle.jdbc.driver.OraclePreparedStatement.setString >>>>> (OraclePreparedStatement.java:4559) >>>>> at >>>>> com.ibatis.sqlmap.engine.type.ParameterSetterImpl.setString >>>>> (ParameterSetterImpl.java:139) >>>>> at >>>>> com.ibatis.sqlmap.engine.type.ClobTypeHandlerCallback.setParameter >>>>> (ClobTypeHandlerCallback.java:45) >>>>> at >>>>> com.ibatis.sqlmap.engine.type.CustomTypeHandler.setParameter >>>>> (CustomTypeHandler.java:46) >>>>> at >>>>> com.ibatis.sqlmap.engine.mapping.parameter.BasicParameterMap.setPa >>>>> rameter(BasicParameterMap.java:165) >>>>> at >>>>> com.ibatis.sqlmap.engine.mapping.parameter.BasicParameterMap.setPa >>>>> rameters(BasicParameterMap.java:125) >>>>> at >>>>> com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate >>>>> (SqlExecutor.java:80) >>>>> at >>>>> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExe >>>>> cuteUpdate(GeneralStatement.java:196) >>>>> at >>>>> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.execut >>>>> eUpdate(GeneralStatement.java:74) >>>>> at >>>>> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.update >>>>> (SqlMapExecutorDelegate.java:500) >>>>> at >>>>> com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.update >>>>> (SqlMapSessionImpl.java:89) >>>>> at >>>>> org.springframework.orm.ibatis.SqlMapClientTemplate >>>>> $11.doInSqlMapClient(SqlMapClientTemplate.java:282) >>>>> at >>>>> org.springframework.orm.ibatis.SqlMapClientTemplate.execute >>>>> (SqlMapClientTemplate.java:140) >>>>> at >>>>> org.springframework.orm.ibatis.SqlMapClientTemplate.update >>>>> (SqlMapClientTemplate.java:280) >>>>> at >>>>> edu.umich.med.umms.tgsubmission.dao.sql.Tgs_info_traineeDaoSql.ins >>>>> ertTgs_info_trainee(Tgs_info_traineeDaoSql.java:67) >>>>> at >>>>> unit.edu.umich.med.umms.tgsubmission.dao.Tgs_info_traineeDaoSqlTes >>>>> tCase.doTestInsert(Tgs_info_traineeDaoSqlTestCase.java:100) >>>>> at >>>>> unit.edu.umich.med.umms.tgsubmission.dao.Tgs_info_traineeDaoSqlTes >>>>> tCase.testAll(Tgs_info_traineeDaoSqlTestCase.java:64) >>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) >>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown >>>>> Source) >>>>> at java.lang.reflect.Method.invoke(Unknown Source) >>>>> at junit.framework.TestCase.runTest(TestCase.java:154) >>>>> at junit.framework.TestCase.runBare(TestCase.java:127) >>>>> at junit.framework.TestResult$1.protect(TestResult.java:106) >>>>> at junit.framework.TestResult.runProtected(TestResult.java:124) >>>>> at junit.framework.TestResult.run(TestResult.java:109) >>>>> at junit.framework.TestCase.run(TestCase.java:118) >>>>> at junit.framework.TestSuite.runTest(TestSuite.java:208) >>>>> at junit.framework.TestSuite.run(TestSuite.java:203) >>>>> at >>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests >>>>> (RemoteTestRunner.java:474) >>>>> at >>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run >>>>> (RemoteTestRunner.java:342) >>>>> at >>>>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main >>>>> (RemoteTestRunner.java:194) >>>>> >>>>> -Henry >>>>> >>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> >>>> >> >> >> >