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

2010-06-25 Thread pieter claassen
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();
}




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

2010-06-25 Thread James Carman
How are you managing transactions?

On Fri, Jun 25, 2010 at 7:27 AM, pieter claassen
pieter.claas...@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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



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

2010-06-25 Thread pieter claassen
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.comwrote:

 How are you managing transactions?

 On Fri, Jun 25, 2010 at 7:27 AM, pieter claassen
 pieter.claas...@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


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

2010-06-25 Thread nino martinez wael
are you using a loadable detachable model or?

2010/6/25 pieter claassen pieter.claas...@gmail.com

 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();
}

 



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

2010-06-25 Thread pieter claassen
Yes, I reload the objects using my DAOs but, I have 2 MySQL databases on the
backend and so far have not been using @Transactional. This might be the
problem.

Now I just have to figure out to configure   tx:annotation-driven
transaction-manager=txManager / for more than one transaction manager and
make sure the different DOAs use the right txManager.

Regards,
Pieter

On Fri, Jun 25, 2010 at 3:30 PM, nino martinez wael 
nino.martinez.w...@gmail.com wrote:

 yeah and grabbig from the dao each time right?


 2010/6/25 pieter claassen pieter.claas...@gmail.com

 Nino,

 No, in this case, I created an inline IModel and overrode the getObject()
 method.

 Pieter


 On Fri, Jun 25, 2010 at 2:59 PM, nino martinez wael 
 nino.martinez.w...@gmail.com wrote:

 are you using a loadable detachable model or?

 2010/6/25 pieter claassen pieter.claas...@gmail.com

 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





-- 
Pieter Claassen
musmato.com


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

2010-06-25 Thread James Carman
These discussions might be of interest to you:

https://jira.springsource.org/browse/SPR-3955

http://forum.springsource.org/showthread.php?t=27754




On Fri, Jun 25, 2010 at 9:34 AM, pieter claassen
pieter.claas...@gmail.com wrote:
 Yes, I reload the objects using my DAOs but, I have 2 MySQL databases on the
 backend and so far have not been using @Transactional. This might be the
 problem.

 Now I just have to figure out to configure   tx:annotation-driven
 transaction-manager=txManager / for more than one transaction manager and
 make sure the different DOAs use the right txManager.

 Regards,
 Pieter

 On Fri, Jun 25, 2010 at 3:30 PM, nino martinez wael 
 nino.martinez.w...@gmail.com wrote:

 yeah and grabbig from the dao each time right?


 2010/6/25 pieter claassen pieter.claas...@gmail.com

 Nino,

 No, in this case, I created an inline IModel and overrode the getObject()
 method.

 Pieter


 On Fri, Jun 25, 2010 at 2:59 PM, nino martinez wael 
 nino.martinez.w...@gmail.com wrote:

 are you using a loadable detachable model or?

 2010/6/25 pieter claassen pieter.claas...@gmail.com

 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





 --
 Pieter Claassen
 musmato.com


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



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

2010-06-25 Thread James Carman
Looks like if you use Spring 3.x, you can do it.  You have to use the
value of the @Transactional annotation to figure out which tx
manager to use.

On Fri, Jun 25, 2010 at 9:58 AM, James Carman
ja...@carmanconsulting.com wrote:
 These discussions might be of interest to you:

 https://jira.springsource.org/browse/SPR-3955

 http://forum.springsource.org/showthread.php?t=27754




 On Fri, Jun 25, 2010 at 9:34 AM, pieter claassen
 pieter.claas...@gmail.com wrote:
 Yes, I reload the objects using my DAOs but, I have 2 MySQL databases on the
 backend and so far have not been using @Transactional. This might be the
 problem.

 Now I just have to figure out to configure   tx:annotation-driven
 transaction-manager=txManager / for more than one transaction manager and
 make sure the different DOAs use the right txManager.

 Regards,
 Pieter

 On Fri, Jun 25, 2010 at 3:30 PM, nino martinez wael 
 nino.martinez.w...@gmail.com wrote:

 yeah and grabbig from the dao each time right?


 2010/6/25 pieter claassen pieter.claas...@gmail.com

 Nino,

 No, in this case, I created an inline IModel and overrode the getObject()
 method.

 Pieter


 On Fri, Jun 25, 2010 at 2:59 PM, nino martinez wael 
 nino.martinez.w...@gmail.com wrote:

 are you using a loadable detachable model or?

 2010/6/25 pieter claassen pieter.claas...@gmail.com

 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





 --
 Pieter Claassen
 musmato.com



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