1.5. Common errors
Prev | Chapter 1. Kodo JDO Frequently Asked Questions | Next

## 1.5. Common errors

1.5.1. When using application identity, what can cause strange behavior like objects not being found?
1.5.2. What causes connection errors when returning persistent instances from a session bean?
1.5.3. What causes a "MissingResourceException" when using Kodo from my application server or IDE?
1.5.4. Why do my relations get lost after I commit?

1.5.1. | When using application identity, what can cause strange behavior like objects not being found?
| The most common cause of problems like these when using application identity is failure for the application identity to properly override the equals() and hashCode() methods as defined at Section 4.5.2, “Application Identity”.
1.5.2. | What causes connection errors when returning persistent instances from a session bean?
| A common cause of this problem is due to the EJB container serializing the instances that are being returned from the EJB. The serialization process happens at a point in the EJB lifecycle where the current status of the transaction is undefined. Since serialization may result in unloaded relations being traversed, Kodo will try to obtain a JDBC Connection to perform the traversal, and the application server may then disallow the connection access due to an invalid transaction status. The simplest solution to this is to either make the object to be returned transient, or return a detached instance, or manually perform the serialization before returning from the EJB method.
1.5.3. | What causes a "MissingResourceException" when using Kodo from my application server or IDE?
| A number of application servers have bugs with loading a resource from an resource adapter. Be sure you follow any instructions that involve extracting the resource adapter as described in Section 4.3, “Installing Kodo JCA”. For MissingResourceException problems in an IDE, be sure to include the `i18nhelper_websphere_patch.jar` file in the build and runtime library dependencies before any instances of the JDO libraries.
1.5.4. | Why do my relations get lost after I commit?
| The problem may be that you have defined an "inverse" extension to have two-sided relations, but you did not set both sides of the relation. Kodo does not perform any "magic" to keep relations consistent; the application must always ensure that the Java object model is consistent.

Prev | Up | Next
1.4. How do I ... ? | Home | 1.6. Productivity tools