Re: non-persistant objects vs transaction



On Fri, 2005-04-29 at 11:14 +0200, Alexander Larsson wrote:

> There is a pretty easy fix for this issue:
> 
> diff -u -p -r1.46 ActiveTopic.java
> --- src/org/gnome/yarrr/ActiveTopic.java        28 Apr 2005 12:23:11 -0000      1.46
> +++ src/org/gnome/yarrr/ActiveTopic.java        29 Apr 2005 09:10:40 -0000
> @@ -50,6 +50,7 @@ public class ActiveTopic extends Topleve
>                 ClosedComment comment = new ClosedComment(this.getTopic(), closer, livecomment.getText(), allAuthors, msgs);
>          addMonitor(comment);
>                 this.getTopic().addClosedComment(comment);
> +        HibernateUtil.commitTransaction();
>          discussion.removeComment(livecomment, closer);
>                 this.signalChanged();
>                 return comment;
> 

Looking at the current code it seems this will not work at all anymore,
since HibernateTransactionInvoker isn't using
HibernateUtil.beginTransaction() and the related calls. This means we
can't do anything fancy with the transaction in an xmlrpc call. Was
there some specific reason for this?

I guess enforcing a simpler model makes it easier to follow the code,
although in some cases (like above) its nice to be able e.g. commit the
transaction earlier.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a bookish umbrella-wielding cowboy on a mission from God. She's a 
vivacious psychic mercenary who inherited a spooky stately manor from her late 
maiden aunt. They fight crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]