0

I am using Eclipse RCP and Eclipselink to create my application: The problem is related to persisting data with eclipselink. This is the situation : The application is composed of the main RCP and a plugin that uses eclipselink to manage data (mysql database). - In the file ApplicationWorkbenchAdvisor" (in the main pluion) when i set configurer.setSaveAndRestore(false); and then i persist data with EM.persist(entity), works fine. but when i change configurer.setSaveAndRestore(false) to true it don't persist changes!, if i change it again to false it works ! Any idea about this problem. Thanks in advance.

2 Answers2

0

I think you are seriously mixing up the UI with the persistence layer, which are two totally separate things.

The setSaveAndRestore from the ApplicationWorkbenchAdvisor reads:

Sets whether the workbench state should be saved on close and restored on subsequent open.

and this has NOTHING to do with your entity manager, or your persistence layer.

The best way to convince yourself of this is to create a simple small Java app (no RCP) and try to persist stuff to the DB. You'll notice using RCP or not has no effect.

Georgian
  • 8,795
  • 8
  • 46
  • 87
0

my db plugin depends on org.eclipse.ui and org.eclipse.core.runtime to provide IContentProposal to one of my Entity class and some of ui contribution, i have removed the dependencies to UI from the db plugin and i disabled temporary content assist; so it works fine. Thank you.