We use Glorp in our application and many years ago, we used to get DuplicatePrimaryKey exception in some cases. Some cases were reproducible in development image, some not. We did not create new objects in the session, so the case was not regarding sql INSERT nor did we work with two sessions, which might also trigger this exception. After loading some objects from database, and calling beginUnitOfWork caused the exception.
In our case (ObjectStudio/VisualWorks), the exception occurred because we use WeakVWCachePolicy. I find WeakVWCachePolicy very nice as objects are thrown out of the cache if not referenced anywhere. Actually the problem was more with Ephemeron than Glorp because Glorp uses EphemeralValueDictionary which is a subclass of EphemeronDictionary. We had the problem with the order in which the objects were finalized by GC. Sometimes, direct references in ephemerons were finalized after indirect references. This triggered the exception.
To solve the problem, we increased the number of strong references to keep (WeakVWCachePolicy>>numberOfElements:). By doing so we didn't get the exception anymore.
I don't know if increasing the number of elements in your cache would help. But give it a try if you use same cache policy as we do.
You received this message because you are subscribed to the Google Groups "glorp-group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to glorp-group...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/glorp-group/ea32a2aa-ea56-41d9-84d8-492dc7f210c4%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to glorp...@googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "glorp-group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/glorp-group/m3cGZquuGjE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to glorp-group...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/glorp-group/3665c7f7-699f-4ae5-848c-1d07a2435eb7%40googlegroups.com.
-- ----------------------------------------------------------------------- Objektfabrik Joachim Tuchel mailto:jtu...@objektfabrik.de Fliederweg 1 http://www.objektfabrik.de D-71640 Ludwigsburg http://joachimtuchel.wordpress.com Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1