You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by James Carman <ja...@carmanconsulting.com> on 2010/06/25 14:22:55 UTC

Re: Listview and hibernate question: Objects don't get deleted before the listview getObject() is called

How are you managing transactions?

On Fri, Jun 25, 2010 at 7:27 AM, pieter claassen
<pi...@gmail.com> wrote:
> I find that when I delete objects from my ListView, my model object for the
> ListView still contains a reference to the object. When the view tries to
> render, the object is already removed from the database and I get a null
> response on my hibernate load(). I use opensessioninview and when I check my
> logs, the delete statement comes way after the view was rendered.
>
> It seems that ListView renders the new view before the transaction is closed
> (but even then, the delete should be visible to later sql in the same
> transaction).
>
> Any ideas?
> Regards,
> Pieter
>
>
>
> Log:
> ====
> Hibernate: delete from ABSTRACTDATASET where ID=?
>
>
> ListView:
> =======
>        ListView documents = new ListView("documents", new IModel() {
>
>            public Object getObject() {
>                return getDocumentList();
>            }
>
> ....
>

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


Re: Listview and hibernate question: Objects don't get deleted before the listview getObject() is called

Posted by pieter claassen <pi...@gmail.com>.
No, my DAO's inherit from HibernateDaoSupport and I just go with the
defaults.

Regards,
Pieter

On Fri, Jun 25, 2010 at 2:22 PM, James Carman <ja...@carmanconsulting.com>wrote:

> How are you managing transactions?
>
> On Fri, Jun 25, 2010 at 7:27 AM, pieter claassen
> <pi...@gmail.com> wrote:
> > I find that when I delete objects from my ListView, my model object for
> the
> > ListView still contains a reference to the object. When the view tries to
> > render, the object is already removed from the database and I get a null
> > response on my hibernate load(). I use opensessioninview and when I check
> my
> > logs, the delete statement comes way after the view was rendered.
> >
> > It seems that ListView renders the new view before the transaction is
> closed
> > (but even then, the delete should be visible to later sql in the same
> > transaction).
> >
> > Any ideas?
> > Regards,
> > Pieter
> >
> >
> >
> > Log:
> > ====
> > Hibernate: delete from ABSTRACTDATASET where ID=?
> >
> >
> > ListView:
> > =======
> >        ListView documents = new ListView("documents", new IModel() {
> >
> >            public Object getObject() {
> >                return getDocumentList();
> >            }
> >
> > ....
> >
>



-- 
Pieter Claassen
musmato.com