[ http://issues.apache.org/jira/browse/IBATIS-191?page=all ]
Clinton Begin closed IBATIS-191:
--------------------------------
Resolution: Fixed
Assign To: Clinton Begin
Fixed as described.
> operation(insert and update) Oracle's(OCI) CLOB and BLOB fail, CLOB will
> close tomcat, BLOB will miss any DATA
> ----------------------------------------------------------------------------------------------------------------
>
> Key: IBATIS-191
> URL: http://issues.apache.org/jira/browse/IBATIS-191
> Project: iBatis for Java
> Type: Bug
> Components: SQL Maps
> Versions: 2.1.5
> Environment: Apache/2.0.47 (Win32) PHP/5.1.0b3 mod_jk/1.2.14
> Tomcat/4.1.27
> jdk1.5.0_02
> Oracle 9i2
> Reporter: Lear.Li
> Assignee: Clinton Begin
>
> operation(insert and update) Oracle's(OCI) CLOB and BLOB fail, CLOB will
> close tomcat, BLOB will miss any DATA
> i has find and fix code in ibatis as:
> com.ibatis.sqlmap.engine.type.ClobTypeHandlerCallback
> public void setParameter(ParameterSetter setter, Object parameter) throws
> SQLException {
> String s = (String) parameter;
> if (s != null) {
> StringReader reader = new StringReader(s);
> setter.setCharacterStream(reader, s.length());
> } else {
> setter.setString(null);
> }
> //setter.setString((String) parameter); // ? why put the line at
> here, i test and find ,set double times, will close tomcat
> }
> issue:
> if remark up line , will ok
> com.ibatis.sqlmap.engine.type.BlobTypeHandlerCallback
> public void setParameter(ParameterSetter setter, Object parameter)
> throws SQLException {
> System.out.println("[Fixed BLOB SET]");
> if (null != parameter) {
> byte[] bytes = (byte[]) parameter;
> ByteArrayInputStream bis=new ByteArrayInputStream(bytes);
> setter.setBinaryStream(bis,(int)(bytes.length));
> //setter.setBytes(bytes); // don't use set byte, use setBinaryStream
> will ok
> }
> }
> issue:
> use setBinaryStream will ok
> wish usefull
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira