I am having a problem where a commit is excluding one attribute when executed in one place but not any others. I have a class ‘Event’ with an attribute ‘assetShip’ which is a many-to-many association with the ‘actShips’ entity. I have several views, all of which include the ‘assetShip’. When I retrieve the ‘Event’ entities in my service bean (using either DataManager or EntityManager), it correctly returns the appropriate ‘assetShip’ attribute.
Within the service bean, I am also programatically creating new 'Event’s and committing them using the following lines.
CommitContext commitContext = new CommitContext(event); dataManager.commit(commitContext);
These new 'Event’s include the ‘assetShip’ attribute. I am also programatically adjusting other attributes of existing 'event’s and committing those changes with the same code (but not modifying the ‘assetShip’ attribute). When I then retrieve all the ‘Event’ entities again, for all events created within the service bean, the ‘assetShip’ attribute is null. Correct values still exist for the old events that had other attributes modified in the same routine which indicates the retrieval process is still fine.
I have traced the code through the ‘DataManagerBean.java’ code that actually performs the commit and confirmed that the ‘assetShip’ attribute is being properly maintained throughout the entire commit process as far as I can tell.
// method that executes within the DataManagerBean.java file Set<Entity> commit(CommitContext context))
Can you help troubleshoot where this attribute might be getting discarded or what other causes there might be?