You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Angelo Chen <an...@yahoo.com.hk> on 2008/06/27 04:44:41 UTC

T5: Hibernate and services

Hi,

As what I understand now that transaction has to be committed to persist the
objects, following is a diapatcher, there is no commit, but the new PageLog
got persisted too, any idea? thanks,

Angelo


public class LoggingDispatcher implements Dispatcher {

    private final HibernateSessionManager sessionManager;

    public LoggingDispatcher(ApplicationStateManager asm, RequestGlobals
requests, HibernateSessionManager sessionManager, IPLookup ipLookup) {
        this.sessionManager = sessionManager;
    }

    public boolean dispatch(Request request, Response response) throws
IOException {

        PageLog log = new PageLog();
        sessionManager.getSession().save(log);

        return false;
    }
-- 
View this message in context: http://www.nabble.com/T5%3A-Hibernate-and-services-tp18147187p18147187.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: Hibernate and services

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi,

This is version 5.0.13, and I turned off the auto commit,
 <property name="hibernate.connection.autocommit">false</property>


Howard Lewis Ship wrote:
> 
> Dependends on the version of Tapestry.  Earlier versions included an
> automatic commit.
> 
> On Thu, Jun 26, 2008 at 7:44 PM, Angelo Chen <an...@yahoo.com.hk>
> wrote:
>>
>> Hi,
>>
>> As what I understand now that transaction has to be committed to persist
>> the
>> objects, following is a diapatcher, there is no commit, but the new
>> PageLog
>> got persisted too, any idea? thanks,
>>
>> Angelo
>>
>>
>> public class LoggingDispatcher implements Dispatcher {
>>
>>    private final HibernateSessionManager sessionManager;
>>
>>    public LoggingDispatcher(ApplicationStateManager asm, RequestGlobals
>> requests, HibernateSessionManager sessionManager, IPLookup ipLookup) {
>>        this.sessionManager = sessionManager;
>>    }
>>
>>    public boolean dispatch(Request request, Response response) throws
>> IOException {
>>
>>        PageLog log = new PageLog();
>>        sessionManager.getSession().save(log);
>>
>>        return false;
>>    }
>> --
>> View this message in context:
>> http://www.nabble.com/T5%3A-Hibernate-and-services-tp18147187p18147187.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator Apache Tapestry and Apache HiveMind
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/T5%3A-Hibernate-and-services-tp18147187p18155441.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5: Hibernate and services

Posted by Howard Lewis Ship <hl...@gmail.com>.
Dependends on the version of Tapestry.  Earlier versions included an
automatic commit.

On Thu, Jun 26, 2008 at 7:44 PM, Angelo Chen <an...@yahoo.com.hk> wrote:
>
> Hi,
>
> As what I understand now that transaction has to be committed to persist the
> objects, following is a diapatcher, there is no commit, but the new PageLog
> got persisted too, any idea? thanks,
>
> Angelo
>
>
> public class LoggingDispatcher implements Dispatcher {
>
>    private final HibernateSessionManager sessionManager;
>
>    public LoggingDispatcher(ApplicationStateManager asm, RequestGlobals
> requests, HibernateSessionManager sessionManager, IPLookup ipLookup) {
>        this.sessionManager = sessionManager;
>    }
>
>    public boolean dispatch(Request request, Response response) throws
> IOException {
>
>        PageLog log = new PageLog();
>        sessionManager.getSession().save(log);
>
>        return false;
>    }
> --
> View this message in context: http://www.nabble.com/T5%3A-Hibernate-and-services-tp18147187p18147187.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org