We are facing the following problem: We are using the persistence-feature to handle complex objects. During the fetch we get values where a datetime-field is not set (NULL in the database) - when we try to write the entity object instance back to the database (merge) we get the following exception:
The reason is quite obvious - the auto-initialized value is out of the allowed range for the MSSQL-Server. But shouldn't NULL be the value to be written back? How can we adress this? A workaround would be to enforce that a date is created during the initial persist but there could be situation where "NULL" is programmtically a valid entry. How can we adress this issue? Edit: RDBMS: MSSQL Express 2008 asked 17.06.2015 at 11:45 Nikel Weis |
There exists an utility which can set auto initialized data class values back to NULL. So you could use it to restore a valid state before you merge it to persistency. Its published here: http://sourceforge.net/ivySupplement/dataClassNuller I did not test if this implementation still works with an up to date ivy version. So you have to verify and test it. answered 22.06.2015 at 09:02 Reguel Werme... ♦♦ I will try out the Data-Nuller - but it is a known problem that dates are auto-initialized even if the persistence returns NULL-values. So IVY's persistence wrapper manipulates data and makes it invalid for the source RDBMS? Am I correct in this interpretation?
(22.06.2015 at 11:22)
Nikel Weis
|
Faces similar problems here, we were able to save auto-initialized date but they were still a pain. Empty date became 0001-01-01. I've fixed it when saving, nice, but now and then when we display a new object we still get 0001-01-01 date in p:calendar into the UI. We will probably find them elsewhere too I guess (data export, reports and the like). We have to track every single one of them and fix them to make sure to display empty date. This is very annoying and not always obvious. It would be great that initialized/uninitialized state don't temper with the data itself. If any global fix exist for that I would be interested. answered 05.12.2016 at 20:16 RemiMorin |
Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
Tags:
Asked: 17.06.2015 at 11:45
Seen: 7,925 times
Last updated: 05.12.2016 at 20:16