You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by osamuo <os...@yahoo.co.jp> on 2008/01/11 10:00:14 UTC
T5: tapestry-hibernate: rollback
Hi,
I have noticed that the tapestry-hibernate commits the current transaction
even after an exception occurs.
Is there any way to do rollback its transaction?
Osamuo
--
View this message in context: http://www.nabble.com/T5%3A-tapestry-hibernate%3A-rollback-tp14752000p14752000.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: tapestry-hibernate: rollback
Posted by osamuo <os...@yahoo.co.jp>.
Hi,
I had mistaken.
I had set 'hibernate.transaction.auto_close_session' instead of
'hibernate.connection.autocommit'.
But I encountered the same condition again when I set
'hibernate.connection.autocommit' to false.
------------------------------------------
<hibernate-configuration>
<session-factory>
<property
name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property
name="hibernate.connection.url">jdbc:postgresql://192.168.0.103/Test</property>
<property name="hibernate.connection.username">test</property>
<property name="hibernate.connection.password">testtest</property>
<property
name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property
name="hibernate.cache.provider_class">net.sf.ehcache.hibernate.EhCacheProvider</property>
<property name="hibernate.connection.autocommit">false</property>
<property name="hibernate.jdbc.use_get_generated_keys">true</property>
<property name="hibernate.cache.use_query_cache">true</property>
<property name="hibernate.bytecode.use_reflection_optimizer">true</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>
<mapping class="TmpUser" />
</session-factory>
</hibernate-configuration>
------------------------------------------
Thanks,
Osamuo
Sven Homburg wrote:
>
> i miss the autocommit property in your config
>
> 2008/1/12, osamuo <os...@yahoo.co.jp>:
>>
>>
>> Hi,
>>
>> Yes, I have.
>> I created 'hibernate.cfg.xml' like the following.
>>
>> ------------------------------------------
>> <hibernate-configuration>
>> <session-factory>
>>
>> <property
>> name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect
>> </property>
>>
>> <property
>> name="hibernate.connection.url
>> ">jdbc:postgresql://192.168.0.103/Test</property>
>> <property name="hibernate.connection.username">test</property>
>> <property name="hibernate.connection.password">testtest</property>
>> <property
>> name="hibernate.connection.driver_class">org.postgresql.Driver</property>
>>
>> <property
>> name="hibernate.cache.provider_class">
>> net.sf.ehcache.hibernate.EhCacheProvider</property>
>>
>> <property
>> name="hibernate.transaction.auto_close_session">false</property>
>>
>> <property name="hibernate.jdbc.use_get_generated_keys">true</property>
>> <property name="hibernate.cache.use_query_cache">true</property>
>> <property name="hibernate.bytecode.use_reflection_optimizer
>> ">true</property>
>>
>> <property name="hibernate.show_sql">true</property>
>> <property name="hibernate.format_sql">true</property>
>>
>> <mapping class="TmpUser" />
>>
>> </session-factory>
>>
>> </hibernate-configuration>
>> ------------------------------------------
>>
>> Thanks,
>> Osamuo
>>
>>
>>
>>
>>
>> Sven Homburg wrote:
>> >
>> > have you set autocommit to off in hibernate config
>> > like this:
>> >
>> > <property name="hibernate.connection.autocommit">false</property>
>> >
>> >
>> >
>> >
>> > osamuo wrote:
>> >>
>> >> Hi,
>> >>
>> >> I used the following code in order to rollback the current
>> transaction.
>> >> But its transaction was committed after the calling
>> >> HibernateSessionManager.abort().
>> >>
>> >> What's wrong?
>> >>
>> >> -------------------------------
>> >> public class RegisterUser{
>> >> ...
>> >>
>> >> @Inject
>> >> private Session session;
>> >>
>> >> @Inject
>> >> private HibernateSessionManager sessionManager;
>> >>
>> >>
>> >> public Object onSubmit(){
>> >> ...
>> >> TmpUser tmpUser = new TmpUser();
>> >> ...
>> >>
>> >> session.save( tmpUser );
>> >> sessionManager.abort(); // force rollback
>> >>
>> >> return null;
>> >> }
>> >> }
>> >> -----------------------------
>> >>
>> >>
>> >> Thanks,
>> >> Osamuo
>> >>
>> >>
>> >> Davor Hrg wrote:
>> >>>
>> >>> HibernateSessionManager
>> >>>
>> >>>
>> >>> On Jan 11, 2008 11:51 AM, Massimo Lusetti <ml...@gmail.com> wrote:
>> >>>> On Jan 11, 2008 10:00 AM, osamuo <os...@yahoo.co.jp> wrote:
>> >>>>
>> >>>> >
>> >>>> > Hi,
>> >>>> >
>> >>>> > I have noticed that the tapestry-hibernate commits the current
>> >>>> transaction
>> >>>> > even after an exception occurs.
>> >>>> >
>> >>>> > Is there any way to do rollback its transaction?
>> >>>>
>> >>>> Use the manager ?
>> >>>>
>> >>>>
>> >>>> --
>> >>>> Massimo
>> >>>> http://meridio.blogspot.com
>> >>>>
>> >>>>
>> >>>>
>> ---------------------------------------------------------------------
>> >>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> >>>> For additional commands, e-mail: users-help@tapestry.apache.org
>> >>>>
>> >>>>
>> >>>
>> >>> ---------------------------------------------------------------------
>> >>> 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-tapestry-hibernate%3A-rollback-tp14752000p14775087.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
>>
>>
>
>
> --
> with regards
> Sven Homburg
>
>
> -----
> best regards
> Sven
>
--
View this message in context: http://www.nabble.com/T5%3A-tapestry-hibernate%3A-rollback-tp14752000p14775449.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: tapestry-hibernate: rollback
Posted by Sven Homburg <ho...@googlemail.com>.
i miss the autocommit property in your config
2008/1/12, osamuo <os...@yahoo.co.jp>:
>
>
> Hi,
>
> Yes, I have.
> I created 'hibernate.cfg.xml' like the following.
>
> ------------------------------------------
> <hibernate-configuration>
> <session-factory>
>
> <property
> name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect
> </property>
>
> <property
> name="hibernate.connection.url
> ">jdbc:postgresql://192.168.0.103/Test</property>
> <property name="hibernate.connection.username">test</property>
> <property name="hibernate.connection.password">testtest</property>
> <property
> name="hibernate.connection.driver_class">org.postgresql.Driver</property>
>
> <property
> name="hibernate.cache.provider_class">
> net.sf.ehcache.hibernate.EhCacheProvider</property>
>
> <property name="hibernate.transaction.auto_close_session">false</property>
>
> <property name="hibernate.jdbc.use_get_generated_keys">true</property>
> <property name="hibernate.cache.use_query_cache">true</property>
> <property name="hibernate.bytecode.use_reflection_optimizer
> ">true</property>
>
> <property name="hibernate.show_sql">true</property>
> <property name="hibernate.format_sql">true</property>
>
> <mapping class="TmpUser" />
>
> </session-factory>
>
> </hibernate-configuration>
> ------------------------------------------
>
> Thanks,
> Osamuo
>
>
>
>
>
> Sven Homburg wrote:
> >
> > have you set autocommit to off in hibernate config
> > like this:
> >
> > <property name="hibernate.connection.autocommit">false</property>
> >
> >
> >
> >
> > osamuo wrote:
> >>
> >> Hi,
> >>
> >> I used the following code in order to rollback the current transaction.
> >> But its transaction was committed after the calling
> >> HibernateSessionManager.abort().
> >>
> >> What's wrong?
> >>
> >> -------------------------------
> >> public class RegisterUser{
> >> ...
> >>
> >> @Inject
> >> private Session session;
> >>
> >> @Inject
> >> private HibernateSessionManager sessionManager;
> >>
> >>
> >> public Object onSubmit(){
> >> ...
> >> TmpUser tmpUser = new TmpUser();
> >> ...
> >>
> >> session.save( tmpUser );
> >> sessionManager.abort(); // force rollback
> >>
> >> return null;
> >> }
> >> }
> >> -----------------------------
> >>
> >>
> >> Thanks,
> >> Osamuo
> >>
> >>
> >> Davor Hrg wrote:
> >>>
> >>> HibernateSessionManager
> >>>
> >>>
> >>> On Jan 11, 2008 11:51 AM, Massimo Lusetti <ml...@gmail.com> wrote:
> >>>> On Jan 11, 2008 10:00 AM, osamuo <os...@yahoo.co.jp> wrote:
> >>>>
> >>>> >
> >>>> > Hi,
> >>>> >
> >>>> > I have noticed that the tapestry-hibernate commits the current
> >>>> transaction
> >>>> > even after an exception occurs.
> >>>> >
> >>>> > Is there any way to do rollback its transaction?
> >>>>
> >>>> Use the manager ?
> >>>>
> >>>>
> >>>> --
> >>>> Massimo
> >>>> http://meridio.blogspot.com
> >>>>
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>
> >>>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> 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-tapestry-hibernate%3A-rollback-tp14752000p14775087.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
>
>
--
with regards
Sven Homburg
Re: T5: tapestry-hibernate: rollback
Posted by osamuo <os...@yahoo.co.jp>.
Hi,
Yes, I have.
I created 'hibernate.cfg.xml' like the following.
------------------------------------------
<hibernate-configuration>
<session-factory>
<property
name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property
name="hibernate.connection.url">jdbc:postgresql://192.168.0.103/Test</property>
<property name="hibernate.connection.username">test</property>
<property name="hibernate.connection.password">testtest</property>
<property
name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property
name="hibernate.cache.provider_class">net.sf.ehcache.hibernate.EhCacheProvider</property>
<property name="hibernate.transaction.auto_close_session">false</property>
<property name="hibernate.jdbc.use_get_generated_keys">true</property>
<property name="hibernate.cache.use_query_cache">true</property>
<property name="hibernate.bytecode.use_reflection_optimizer">true</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>
<mapping class="TmpUser" />
</session-factory>
</hibernate-configuration>
------------------------------------------
Thanks,
Osamuo
Sven Homburg wrote:
>
> have you set autocommit to off in hibernate config
> like this:
>
> <property name="hibernate.connection.autocommit">false</property>
>
>
>
>
> osamuo wrote:
>>
>> Hi,
>>
>> I used the following code in order to rollback the current transaction.
>> But its transaction was committed after the calling
>> HibernateSessionManager.abort().
>>
>> What's wrong?
>>
>> -------------------------------
>> public class RegisterUser{
>> ...
>>
>> @Inject
>> private Session session;
>>
>> @Inject
>> private HibernateSessionManager sessionManager;
>>
>>
>> public Object onSubmit(){
>> ...
>> TmpUser tmpUser = new TmpUser();
>> ...
>>
>> session.save( tmpUser );
>> sessionManager.abort(); // force rollback
>>
>> return null;
>> }
>> }
>> -----------------------------
>>
>>
>> Thanks,
>> Osamuo
>>
>>
>> Davor Hrg wrote:
>>>
>>> HibernateSessionManager
>>>
>>>
>>> On Jan 11, 2008 11:51 AM, Massimo Lusetti <ml...@gmail.com> wrote:
>>>> On Jan 11, 2008 10:00 AM, osamuo <os...@yahoo.co.jp> wrote:
>>>>
>>>> >
>>>> > Hi,
>>>> >
>>>> > I have noticed that the tapestry-hibernate commits the current
>>>> transaction
>>>> > even after an exception occurs.
>>>> >
>>>> > Is there any way to do rollback its transaction?
>>>>
>>>> Use the manager ?
>>>>
>>>>
>>>> --
>>>> Massimo
>>>> http://meridio.blogspot.com
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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-tapestry-hibernate%3A-rollback-tp14752000p14775087.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: tapestry-hibernate: rollback
Posted by Sven Homburg <ho...@googlemail.com>.
have you set autocommit to off in hibernate config
like this:
<property name="hibernate.connection.autocommit">false</property>
osamuo wrote:
>
> Hi,
>
> I used the following code in order to rollback the current transaction.
> But its transaction was committed after the calling
> HibernateSessionManager.abort().
>
> What's wrong?
>
> -------------------------------
> public class RegisterUser{
> ...
>
> @Inject
> private Session session;
>
> @Inject
> private HibernateSessionManager sessionManager;
>
>
> public Object onSubmit(){
> ...
> TmpUser tmpUser = new TmpUser();
> ...
>
> session.save( tmpUser );
> sessionManager.abort(); // force rollback
>
> return null;
> }
> }
> -----------------------------
>
>
> Thanks,
> Osamuo
>
>
> Davor Hrg wrote:
>>
>> HibernateSessionManager
>>
>>
>> On Jan 11, 2008 11:51 AM, Massimo Lusetti <ml...@gmail.com> wrote:
>>> On Jan 11, 2008 10:00 AM, osamuo <os...@yahoo.co.jp> wrote:
>>>
>>> >
>>> > Hi,
>>> >
>>> > I have noticed that the tapestry-hibernate commits the current
>>> transaction
>>> > even after an exception occurs.
>>> >
>>> > Is there any way to do rollback its transaction?
>>>
>>> Use the manager ?
>>>
>>>
>>> --
>>> Massimo
>>> http://meridio.blogspot.com
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>
>
-----
best regards
Sven
--
View this message in context: http://www.nabble.com/T5%3A-tapestry-hibernate%3A-rollback-tp14752000p14774442.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: tapestry-hibernate: rollback
Posted by osamuo <os...@yahoo.co.jp>.
Hi,
I used the following code in order to rollback the current transaction.
But its transaction was committed after the calling
HibernateSessionManager.abort().
What's wrong?
-------------------------------
public class RegisterUser{
...
@Inject
private Session session;
@Inject
private HibernateSessionManager sessionManager;
public Object onSubmit(){
...
TmpUser tmpUser = new TmpUser();
...
session.save( tmpUser );
sessionManager.abort(); // force rollback
return null;
}
}
-----------------------------
Thanks,
Osamuo
Davor Hrg wrote:
>
> HibernateSessionManager
>
>
> On Jan 11, 2008 11:51 AM, Massimo Lusetti <ml...@gmail.com> wrote:
>> On Jan 11, 2008 10:00 AM, osamuo <os...@yahoo.co.jp> wrote:
>>
>> >
>> > Hi,
>> >
>> > I have noticed that the tapestry-hibernate commits the current
>> transaction
>> > even after an exception occurs.
>> >
>> > Is there any way to do rollback its transaction?
>>
>> Use the manager ?
>>
>>
>> --
>> Massimo
>> http://meridio.blogspot.com
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> 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-tapestry-hibernate%3A-rollback-tp14752000p14770190.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: tapestry-hibernate: rollback
Posted by Davor Hrg <hr...@gmail.com>.
HibernateSessionManager
On Jan 11, 2008 11:51 AM, Massimo Lusetti <ml...@gmail.com> wrote:
> On Jan 11, 2008 10:00 AM, osamuo <os...@yahoo.co.jp> wrote:
>
> >
> > Hi,
> >
> > I have noticed that the tapestry-hibernate commits the current transaction
> > even after an exception occurs.
> >
> > Is there any way to do rollback its transaction?
>
> Use the manager ?
>
>
> --
> Massimo
> http://meridio.blogspot.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: T5: tapestry-hibernate: rollback
Posted by Massimo Lusetti <ml...@gmail.com>.
On Jan 11, 2008 10:00 AM, osamuo <os...@yahoo.co.jp> wrote:
>
> Hi,
>
> I have noticed that the tapestry-hibernate commits the current transaction
> even after an exception occurs.
>
> Is there any way to do rollback its transaction?
Use the manager ?
--
Massimo
http://meridio.blogspot.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org