You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i am using spring batch with Jdbc and Postgres DB. all the job and step execution context data gets saved in spring batch created tables in PostgreS DB.
i am using it to save some step context data, which gets saved in batch_step_execution_context table in the column SERIALIZED_CONTEXT. the data i am saving has some MBCS characters.
but i see that when writing data to the table and reading from it its using ISO-8859-1 charset. hence my mbcs characters though serialized by Xstream default serializer gets stored as garbage.
any way to workaround this, so i can retrieve and save data as MBCS.
please find the code snippet from JDBCExecutionContextDao.
on some suggestions on stackoverflow tried Jackson2ExecutionContextStringSerializer along with XStreamExecutionContextStringSerializer . but the issue exists.
as a workaround i myseld converted the object to base64 encoded string and then saved it to step execution context. but would like spring batch to take care of this.
The default encoding in JdbcExecutionContextDao has been changed to UTF-8 (see #3983), which should fix this issue. If not, please re-open it and provide a minimal complete example that reproduces the problem.
Uh oh!
There was an error while loading. Please reload this page.
shreyas deshpande opened BATCH-2850 and commented
i am using spring batch with Jdbc and Postgres DB. all the job and step execution context data gets saved in spring batch created tables in PostgreS DB.
i am using it to save some step context data, which gets saved in batch_step_execution_context table in the column SERIALIZED_CONTEXT. the data i am saving has some MBCS characters.
but i see that when writing data to the table and reading from it its using ISO-8859-1 charset. hence my mbcs characters though serialized by Xstream default serializer gets stored as garbage.
any way to workaround this, so i can retrieve and save data as MBCS.
please find the code snippet from JDBCExecutionContextDao.
i expect to store and retrieve mbcs data.
on some suggestions on stackoverflow tried Jackson2ExecutionContextStringSerializer along with XStreamExecutionContextStringSerializer . but the issue exists.
as a workaround i myseld converted the object to base64 encoded string and then saved it to step execution context. but would like spring batch to take care of this.
Affects: 3.0.10
Reference URL: https://stackoverflow.com/questions/56599638/mbcs-data-in-stepexecution-in-spring-batch-database/56600147#56600147
The text was updated successfully, but these errors were encountered: