I found what was wrong, the begin() was not at the right place :

     query = ...
     homeobj = (Home) query.getSingleResult();
     _ut.begin();
     homeobj.setTitle("new-title");
     _ut.commit();

Sorry for the trouble. I'll write a little sample to clarify all that 
(for me at least)

The @TransactionAttribute still does the error "cannot read: 
mp/adminservlet.java"

this is the function :

@TransactionAttribute
   public boolean set_homeinfo(int id_user,String title)

Scott Ferguson wrote:
> Can you turn on the log for this to make sure it's in a transaction?   
> The @TransactionAttribute must be on a protected or public method, by  
> the way.  There was a missing validation that didn't report an error  
> on a private method.
> 
> I've just tested that case for the Query inside a transaction and the  
> changed data is getting properly updated in my example.
> 
> e.g.
> 
> @In UserTransaction _ut;
> 
> void foo()
> {
>    _ut.begin();
> 
>    query = ...
>    homeobj = (Home) query.getSingleResult();
>    homeobj.setTitle("new-title");
> 
>    _ut.commit();
> }
> 
> or
> 
> @TransactionAttribute
> protected void foo()
> {
>    query = ...;
>    homeobj = (Home) query.getSingleResult();
>    homeobj.setTitle("new-title");
> }
> 
> -- Scott
> 

-- 
Très cordialement,

Riccardo Cohen
-------------------------------------------
Articque
http://www.articque.com
149 av Général de Gaulle
37230 Fondettes - France
tel : 02-47-49-90-49
fax : 02-47-49-91-49



_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to