JDBC connection cache can not save long string
I defined the variables in Cache, as follows:
Property Content As% Stream.GlobalCharacter [Required, SqlColumnNumber = 3, SqlFieldName = B_Content];
And then use the SQL statement to add:
insert into table_name (B_Content) values ('very long string');
But the error:
org.springframework.http.converter.HttpMessageNotWritableException: Could not write content: No serializer found for class com.intersys.jdbc.CacheInputStream and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com .sxxxx.jdbc.datastore.SqlQueryResultVo ["root"] -> java.util.ArrayList [0] -> org.springframework.util.LinkedCaseInsensitiveMap ["B_CONTENT"]); nested exception is com.fasterxml.jackson.databind. JasonMappingException: No serializer found for class com.intersys.jdbc.CacheInputStream and no properties discovered create create bean () to create a buenSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.xxxxxx.jdbc.datastore.SqlQueryResultVo [ -> java.util.ArrayList [0] -> org.springframework.util.LinkedCaseInsensitiveMap ["B_CONTENT"])
Also need to query and update B_Content, how can I handle it? Thank you.
Please open a WRC support case and we will be able to assist you with this problem.
Worldwide Response Center (WRC)
Support phone:
+1-617-621-0700
+44 (0) 844 854 2917
Support email:
support@intersystems.com
Support online:
WRC Direct
Contact support@intersystems.com for a login.
I found the problem, our company's own package to save data through the JavaScript to the database (through Ajax way), I changed to Java (JdbcTemplate) directly save the data, the problem is solved.
This works for me. I used this class definition:
Class Test.JDBCStream extends %Persistent { Property Content as %Stream.GlobalCharacter; }
And the following query form SQuirreL SQL on Mac worked fine:
INSERT INTO Test.JDBCStream (Content) VALUES ('A long String')
So I'm not sure exactly what you're doing. Do you have code? Examples?
As Len stated yesterday, you should open a WRC Issue.
Edit: Sorry this post looks bad, the text editor on this site is awful.
Moderator: fixed
Post Moderator Edit: Still looks bad, lost the syntax highlighting, and being able to edit people's posts kind of ruins the point of an open forum.