Giter Site home page Giter Site logo

Comments (10)

dzxiang avatar dzxiang commented on May 9, 2024

大家都没有碰到过这个问题吗?

from shardingsphere.

hzlzz avatar hzlzz commented on May 9, 2024

我也碰到了这个问题 请问有解决方案吗

from shardingsphere.

dzxiang avatar dzxiang commented on May 9, 2024

在:com.dangdang.ddframe.rdb.sharding.jdbc.adapter.AbstractPreparedStatementAdapter中临时打了一个小补丁:
private void setParameter(final int index, final Object x) throws SQLException {
int extendedSize = index - parameters.size();
if (extendedSize > 1) {
while (--extendedSize > 0) {
parameters.add(null);
}
}
if(x instanceof java.io.StringReader){
Reader reader = (Reader)x;
BufferedReader r = null;
StringBuilder b = new StringBuilder();
String line;
try {
r = new BufferedReader(reader);
boolean first = true;
String ls = System.getProperty("line.separator");
while((line=r.readLine())!=null) {
if(first) first = false;
else b.append(ls);
b.append(line);
}

            String y = b.toString();
            parameters.add(index - 1,y);
        } catch (IOException e) {
            e.printStackTrace();
            throw new SQLException(e);
        } finally{
            if(r!=null){
                try {
                    r.close();
                } catch (IOException e) {}
            }
        }
    }
    else{
        parameters.add(index - 1, x);   
    }
}

from shardingsphere.

billForgithub avatar billForgithub commented on May 9, 2024

我也碰到了这个问题

from shardingsphere.

duran-zhu avatar duran-zhu commented on May 9, 2024

修复这个bug的代码会导致使用mybatis自增id出错。
在insert语句后,执行select last_insert_id() from dual出现空指针问题。

from shardingsphere.

shuohao avatar shuohao commented on May 9, 2024

我也遇到了 请问这个现在如何解决啊

from shardingsphere.

runbestfast avatar runbestfast commented on May 9, 2024

3.0也有这个问题,#{reqMsg,jdbcType=LONGVARCHAR}
如果是非基础类型,mysql的jdbc驱动调用了
com.mysql.cj.AbstractQueryBindings#setObject
com.mysql.cj.AbstractQueryBindings#setSerializableObject
stringReader不能序列化,抛出异常
Caused by: com.mysql.cj.exceptions.WrongArgumentException: Invalid argument value: java.io.NotSerializableException

from shardingsphere.

shenmimoon avatar shenmimoon commented on May 9, 2024

3.0也有这个问题,#{reqMsg,jdbcType=LONGVARCHAR}
如果是非基础类型,mysql的jdbc驱动调用了
com.mysql.cj.AbstractQueryBindings#setObject
com.mysql.cj.AbstractQueryBindings#setSerializableObject
stringReader不能序列化,抛出异常
Caused by: com.mysql.cj.exceptions.WrongArgumentException: Invalid argument value: java.io.NotSerializableException

+1

from shardingsphere.

shuohao avatar shuohao commented on May 9, 2024

对 jdbctype为longvarchar就会报这个错

from shardingsphere.

terrymanu avatar terrymanu commented on May 9, 2024

For English only, other languages will not accept.
I just lock this issue. If you want, you can submit a new issue with English

from shardingsphere.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.