users@glassfish.java.net

Re: From NetBeans bundle version to server

From: Mauro Chiarugi - Dogma Systems <mauro.chiarugi_at_dogmasystems.it>
Date: Tue, 26 Aug 2008 16:15:37 +0200

Wim Verreycken ha scritto:
> It might be easier to use CMP with annotations like I did in the example.
> This has the effect of not having to rollback transactions in case of
> exceptions since it will be done automagically.
> You will have to use
> @TransactionAttribute(TransactionAttributeType.REQUIRED)
> however to trigger the automatic rollback feature.
>
I've tried with annotation too, as you wrote in previous email.. But I
obtain the same exception.

Fortunately I found a web page that suggest me the solutions using
annotations (many thanks Wim!).
First of all, declare:

@Resource private UserTransaction utx;

Then, the transaction become:

utx.begin();
persist(cliente);
utx.commit();

Many thanks!!

Regards,
Mauro Chiarugi

PS. But why all is ok in the Glassfish in bundle with NetBeans??? :-/

-- 
Mauro Chiarugi
Dogma Systems Srl:
http://www.dogmasystems.it
MyRent, Car Rental Software:
http://www.myrent.it
http://www.myrent.es
http://www.myrent.eu
Email:	mauro.chiarugi [at] dogmasystems.it
Tel :	+39 071 90 90 188
Fax :   +39 071 250 99 63