Community
Participate
Working Groups
Adding the same image second time exception is thrown from DB: "The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'CDO_LOBS_IDX0' defined on 'CDO_LOBS'."
Created attachment 199039 [details] test case v1 Test case illustrating problem
Created attachment 199048 [details] test case+patch Byte array was used as map key. Array by itselv doesn't construct hashcode from the arrays values. It means values are the same but array object is different
Created attachment 199066 [details] Alternative fix v1
While my alternative version of a fix is slightly more code but I think it's cleaner because duplicates are already prevented in the "lobs" map. That said, both our fixes make the reading cases in LobTest fail. Can you have a look at it?
Patch seems to be good :)
What about the test failures?
Created attachment 199105 [details] fix v2 Includes MEMStore fix
There are lines in test: "new java.io.File(CDOLobStoreImpl.INSTANCE.getFolder(), "5ef5685c7036c7fc8cafac1d54b91b4e06d9de4e.clob").delete();" Eike, could you take a look to this line. If it is still makes what expected? For me such file doesn't exist always
Committed revision 8597 I've enhanced the test case so that it uses the lob ID actually computed for a Lob rather than a fixed ID that was valid at the time when the test was originally developed.
Created attachment 199106 [details] Alternative fix v3 With ByteArrayWrapper
Committed to trunk, revision 8598
Closing.