users@glassfish.java.net

Re: persist error - no active transaction on Remote Stateless Session Bean

From: Sahoo <Sahoo_at_Sun.COM>
Date: Mon, 23 Feb 2009 09:53:22 +0530

The default transaction management type for an EJB is CONTAINER and
default transaction attribute for a business method is REQUIRED. So, if
you call the EJB method using an EJB reference irrespective of calling
from an web service or a plain Java client or a servlet, it should start
a transaction for you. See [1] & [2] for example.

[1]
http://weblogs.java.net/blog/ss141213/archive/2005/12/entitymanagerpe_1.html
[2]
http://weblogs.java.net/blog/ss141213/archive/2005/12/using_java_pers.html

glassfish_at_javadesktop.org wrote:
> I wrote a stateles session bean to persist entities.
>
> It has a remote interface.
>
> I call the bean from web service.
>
> I am using eclipselink 1.0.1 inside Glassfish V2
> Sun Java System Application Server 9.1_02 (build b04-fcs)
>
> The file persistence.xml has JTA enabled,
> also <property name="eclipselink.cache.shared.default" value="false"/>
>
> the persist instruction does not write data to the database.
>
> If I try to flush after persist, I get error "No transaction is currently active".
>
> I have also tried transactionManagementType.Bean with UserTransaction but it does not work.
>
> I have attached both bean and webservice.
>
> Thank you
> [Message sent by forum member 'antoniojsg' (antoniojsg)]
>
> http://forums.java.net/jive/thread.jspa?messageID=333284
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>