Announcement Announcement Module
Collapse
No announcement yet.
Basic Transactoin Issue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Basic Transactoin Issue

    i've been trying to get this done to get Spring to manage my transaction but i keep getting this as a stacktrace



    Code:
    Hibernate: select this_.id_Grupo as id1_6_1_, this_.grupo as grupo6_1_, roleses2_.id_grupo as id1_3_, roles3_.id_role as id2_3_, roles3_.id_role as id1_7_0_, roles3_.role as role7_0_ from ksique.grupos this_ left outer join ksique.role_grupos roleses2_ on this_.id_Grupo=roleses2_.id_grupo left outer join ksique.roles roles3_ on roleses2_.id_role=roles3_.id_role where this_.grupo=?
    2009-12-21 00:40:29,952 [httpSSLWorkerThread-8080-2] INFO  org.ksique.logic.services.impl.UsuarioServiceImpl - [org.ksique.persistence.Grupos@c21750]
    2009-12-21 00:40:29,952 [httpSSLWorkerThread-8080-2] INFO  org.ksique.logic.services.impl.UsuarioServiceImpl - [org.ksique.persistence.Grupos@c21750]
    Received 'org.hibernate.HibernateException' when invoking action listener '#{rolesUI.crearUsuario}' for component 'j_id68'
    org.hibernate.HibernateException: save is not valid without active transaction
            at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:297)
            at $Proxy75.save(Unknown Source)
            at org.ksique.persistence.dao.impl.UsuarioImpl.add(UsuarioImpl.java:48)
            at org.ksique.persistence.dao.impl.UsuarioImpl.add(UsuarioImpl.java:17)
            at org.ksique.logic.services.impl.UsuarioServiceImpl.add(UsuarioServiceImpl.java:62)
            at org.ksique.logic.services.impl.UsuarioServiceImpl.add(UsuarioServiceImpl.java:24)
            at org.ksique.ui.support.RoleSupport.createUser(RoleSupport.java:55)
            at org.ksique.ui.backing.UIRoles.crearUsuario(UIRoles.java:124)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at com.sun.el.parser.AstValue.invoke(AstValue.java:187)
            at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
            at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
            at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:88)
            at javax.faces.event.ActionEvent.processListener(ActionEvent.java:77)
            at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:746)
            at javax.faces.component.UICommand.broadcast(UICommand.java:368)
            at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
            at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
            at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
            at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
            at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
            at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:18)
            at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCycle(ReceiveSendUpdates.java:132)
            at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:74)
            at com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:31)
            at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24)
            at com.icesoft.faces.webapp.http.servlet.BasicAdaptingServlet.service(BasicAdaptingServlet.java:16)
            at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
            at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:53)
            at com.icesoft.faces.webapp.http.servlet.SessionVerifier.service(SessionVerifier.java:26)
            at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
            at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:131)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
            at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:56)
            at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:315)
            at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
            at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
            at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
            at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288)
            at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647)
            at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:579)
            at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:831)
            at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
            at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
            at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
            at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
            at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)

    Don't know why i have configure my transaction with
    Code:
     <tx:annotation-driven/>
    And annotated my class

    Code:
    @Transactional
    public class UsuarioServiceImpl implements UsuarioService
    Any thoughs on this one???

    Thanks

  • #2
    ha found my answer here

    http://forum.springsource.org/newrep...ote=1&p=274877

    but i did not quite understand the reason does hibernate managed its own SessionContext

    Comment

    Working...
    X