java.io.NotSerializableException
occurred when setting parameters into PreparedStatement
#2105
Labels
java.io.NotSerializableException
occurred when setting parameters into PreparedStatement
#2105
table_demo (id int primary key, column_a int, column_b longtext)
mybatis dynamic sql like this:
If jdbcType of columnB is specified as
org.apache.ibatis.type.JdbcType.LONGVARCHAR
, this parameter will be handled inSimpleExecutor.preparedStatement(..)
method, and thenorg.apache.ibatis.type.ClobTypeHandler.setNonNullParameter(..)
method will be called.Type of column_b will be packaged in StringReader, thus the
parameters
property's type in ShardingPreparedStatement will be set to StringReader.Subsequently,
replaySetParameter(final PreparedStatement preparedStatement, final List<Object> parameters)
will be called inShardingPreparedStatement's route()
method.When the code goes to
each.invoke(preparedStatement);
,com.mysql.jdbc.PreparedStatement.setObject(int parameterIndex, Object parameterObj)
will be invoked, andStringReader
cannot be identified byPreparedStatement
, thensetSerializableObject
will be called, butStringReader
doesnot implementSerializable
, sojava.io.NotSerializableException
occur.The text was updated successfully, but these errors were encountered: