#3299: use postgres function convert_from() instead of encode() to insert JSON byte stream into PreparedStatement.

This works with session attributes containing special characters in the JSON blob.
This commit is contained in:
Rüdiger Schulz
2025-01-07 20:15:52 +01:00
committed by Rob Winch
parent 3b7d9f3baa
commit d295bff7cb
2 changed files with 4 additions and 4 deletions

View File

@@ -23,7 +23,7 @@ public class SessionConfig implements BeanClassLoaderAware {
private static final String CREATE_SESSION_ATTRIBUTE_QUERY = """
INSERT INTO %TABLE_NAME%_ATTRIBUTES (SESSION_PRIMARY_ID, ATTRIBUTE_NAME, ATTRIBUTE_BYTES)
VALUES (?, ?, encode(?, 'escape')::jsonb)
VALUES (?, ?, convert_from(?, 'UTF8')::jsonb)
""";
private static final String UPDATE_SESSION_ATTRIBUTE_QUERY = """