1

In org.javers.repository.sql.finders.CdoSnapshotFinder#fetchCdoSnapshots method a list of CdoSnapshotSerialized is getting converted to a list of CdoSnapshot.

Is there a public API to get a list of serialized CdoSnapshotSerialized (the way they appear in DB)?

ITisha
  • 902
  • 2
  • 12
  • 14
  • there is no such API in javers. I'm curious, why you need more **raw** data than `CdoSnapshot`, could you explain your case? – Bartek Walacik Oct 07 '19 at 21:23
  • @Bartek, thanks for your reply. We have a problem when we first try to read Snapshots/Shadws/Changes from the DB after server restart. There is an entity with `@OneToMany` referenced collection elements of which have @EmbeddedId. And those embedded ids are failed to deserialize to a corresponding EmbeddedId object even though there is a gson-like adapter registered. The strange thing is after entity update everything is read correctly. Gson seem to be failing to find adapter for interface `java.util.List['class org.javers.core.metamodel.object.GlobalId']` untill entity update. Too long, sorry. – ITisha Oct 08 '19 at 12:22
  • @Bartek can you suggest a way how I can create a test for a case like this? When there is already a snapshot in the DB and only then we initialize javers and read it. – ITisha Oct 08 '19 at 14:02
  • You mean a test in which javers instance is restarted? – Bartek Walacik Oct 09 '19 at 05:34
  • @Bartek, yes, maybe there is some kind of similar test. Any suggestion would be helpful. I can describe the problem I got in details but it would take much more space than comment area allows. I you could give me any direstion I'd start working oin that ASAP. – ITisha Oct 09 '19 at 07:15
  • 1
    take a look how we write more advanced tests for some corner cases, maybe it will inspire you https://github.com/javers/javers/blob/df6b8d53790c8986e158130f9172e430a6690240/javers-persistence-sql/src/test/groovy/org/javers/repository/sql/JaversSqlRepositoryE2ETest.groovy#L114 writing a test case is the best way to define the issue – Bartek Walacik Oct 09 '19 at 12:37
  • Thanks a lot for your suggestion @Bartek! I was able to reproduce it in tests and posted a case #897 to github. – ITisha Oct 10 '19 at 09:00

0 Answers0