203 words

@Entity saved in Tomcat session - problem

2010-12-13 14:42


I have found a problem, when storing @Entity object in Tomcat session. When starting or stopping Tomcat, I get nasty exception - please check attached log. Strange thing is, that after this exception everything works perfectly fine. The problem appears after using Enhancer.

The nasty solution is to create copy of @Entity class as normal POJO and use it to store in session. The problem is, that we need the same logic for temporary users (without storing in DB) and permanent users (stored in database). A separate POJO makes the whole logic quite complicated.

Any thoughts on this?

lwalkowski's picture
Joined on 2010-08-25
User Post #4
2010-12-13 16:47

The exception indicates an attempt to serialize an entity object (when Tomcat stores the session before shutdown) that failed due to an inverse (mapped by) field in the entity object.

Version 2.0.3 should fix this serialization problem. Please try it.

Notice that after stopping and starting Tomcat entity objects in the session will be detached.

Thank you for this report.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support's picture
Joined on 2010-05-03
User Post #86

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Maximum file size: 32 MB