环境:
问题:
当我尝试使用大于32766字符的字符串执行此代码时,我会遇到异常:
Query updateQuery = getEntityManager().createNativeQuery("Insert into CLOB_TEST (ID,CLOB_COLUMN)values(120001,?)");
updateQuery.setParameter(1, "CLOB VALUE");
updateQuery.executeUpdate();
例外:
SQLException: setString can only process strings of less than 32766
要求:
解决方法:
我能够通过使用从本机oracle连接接收的PreparedStatement来克服此限制,但后来我无法使用@Transaction注释管理事务,因为我正在省略entityManager。
问题:
有没有办法克服这个限制而不会失去JPA事务管理功能?