[Teneo+Hibernate] IAction: the chosen operation is currently not available [message #82059] |
Sat, 05 May 2007 05:25  |
Eclipse User |
|
|
|
Originally posted by: nospam.eric.gmail.com
Hi,
I try to use Teneo in combination w/ Hibernate but I face some problems when
writing some test code involving Teneo and Hibernate in the run method of an
IAction. When running the application, I get a dialog box w/ the message
"The chosen operation is currently not available".
Could someone help me finding out what's wrong in the following piece of
code which prevent me from getting the job done when I click on the button
associated w/ the action?
Many thanks,
Eric
public void run(final IAction action) {
String dataStoreName;
dataStoreName = "LibraryDataStore";
HbDataStore dataStore;
dataStore = HbHelper.INSTANCE.createRegisterDataStore(dataStoreName);
dataStore.setEPackages(new EPackage[] { RezeptePackage.eINSTANCE });
dataStore.initialize();
SessionFactory sessionFactory;
sessionFactory = dataStore.getSessionFactory();
Session session;
session = sessionFactory.openSession();
session.beginTransaction();
Recipe recipe;
recipe = RezepteFactory.eINSTANCE.createRecipe();
recipe.setName("Chocolat");
session.save(recipe);
session.getTransaction().commit();
session.close();
dataStore.close();
}
|
|
|
Re: [Teneo+Hibernate] IAction: the chosen operation is currently not available [message #82075 is a reply to message #82059] |
Sat, 05 May 2007 05:48  |
Eclipse User |
|
|
|
Hi Eric,
The code looks fine, Probably a strack trace of the underlying exception will give some more
information.
gr. martin
Eric DELAGE wrote:
> Hi,
>
> I try to use Teneo in combination w/ Hibernate but I face some problems when
> writing some test code involving Teneo and Hibernate in the run method of an
> IAction. When running the application, I get a dialog box w/ the message
> "The chosen operation is currently not available".
>
> Could someone help me finding out what's wrong in the following piece of
> code which prevent me from getting the job done when I click on the button
> associated w/ the action?
>
> Many thanks,
>
> Eric
>
>
> public void run(final IAction action) {
>
>
> String dataStoreName;
>
>
> dataStoreName = "LibraryDataStore";
>
>
> HbDataStore dataStore;
>
>
> dataStore = HbHelper.INSTANCE.createRegisterDataStore(dataStoreName);
>
> dataStore.setEPackages(new EPackage[] { RezeptePackage.eINSTANCE });
>
> dataStore.initialize();
>
>
> SessionFactory sessionFactory;
>
>
> sessionFactory = dataStore.getSessionFactory();
>
>
> Session session;
>
>
> session = sessionFactory.openSession();
>
> session.beginTransaction();
>
>
> Recipe recipe;
>
>
> recipe = RezepteFactory.eINSTANCE.createRecipe();
>
> recipe.setName("Chocolat");
>
> session.save(recipe);
>
>
> session.getTransaction().commit();
>
> session.close();
>
>
> dataStore.close();
>
>
> }
>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: [Teneo+Hibernate] IAction: the chosen operation is currently not available [message #605277 is a reply to message #82059] |
Sat, 05 May 2007 05:48  |
Eclipse User |
|
|
|
Hi Eric,
The code looks fine, Probably a strack trace of the underlying exception will give some more
information.
gr. martin
Eric DELAGE wrote:
> Hi,
>
> I try to use Teneo in combination w/ Hibernate but I face some problems when
> writing some test code involving Teneo and Hibernate in the run method of an
> IAction. When running the application, I get a dialog box w/ the message
> "The chosen operation is currently not available".
>
> Could someone help me finding out what's wrong in the following piece of
> code which prevent me from getting the job done when I click on the button
> associated w/ the action?
>
> Many thanks,
>
> Eric
>
>
> public void run(final IAction action) {
>
>
> String dataStoreName;
>
>
> dataStoreName = "LibraryDataStore";
>
>
> HbDataStore dataStore;
>
>
> dataStore = HbHelper.INSTANCE.createRegisterDataStore(dataStoreName);
>
> dataStore.setEPackages(new EPackage[] { RezeptePackage.eINSTANCE });
>
> dataStore.initialize();
>
>
> SessionFactory sessionFactory;
>
>
> sessionFactory = dataStore.getSessionFactory();
>
>
> Session session;
>
>
> session = sessionFactory.openSession();
>
> session.beginTransaction();
>
>
> Recipe recipe;
>
>
> recipe = RezepteFactory.eINSTANCE.createRecipe();
>
> recipe.setName("Chocolat");
>
> session.save(recipe);
>
>
> session.getTransaction().commit();
>
> session.close();
>
>
> dataStore.close();
>
>
> }
>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Powered by
FUDForum. Page generated in 0.05554 seconds