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.

  • 0
  • 0
  • 331
  • 1
  • 2

Answers

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.

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.