We too have had many problems when upgrading from 2.1. to 3.0.

I don't know the open session in view filter, but could it be that it doesn't come by the filter when issuing the multipart request? You could check by setting a breakpoint in that filter.

Btw, most of our problems had to do with final classes and methods. When you make your pojo's final, Hibernate will scream at you, which is fine as you know you have a problem. However, when you have final methods in non final classes, you're up for some surprises!

Eelco


叶卫国 wrote:

Eelco Hillenius,

        I use spring's OpenSessionInViewFilter to open and colse hibernate 
session. When i use hibernate 2, all works fine, recently i upgrade hibernate 
to 3.0 ...

======= 2005-06-17 22:46:37 :=======

Actually ONE_PASS_RENDER should work just as good as REDIRECT_TO_BUFFER. If that is not the case, you're probably storing hibernate objects in your session (like keeping a reference to it from a component, or us it in a (non-detachable) model.

Another trick to get around problems like these is to unproxy your objects. Look at HibernateObjectModel from wicket-contrib-data-hibernate-xx for an example.

Eelco


叶卫国 wrote:

Eelco Hillenius,

        The 'ONE_PASS_RENDER' strategy can not work too, why...?

======= 2005-06-17 21:44:11 :=======



First, when you work with Hibernate, you should work with detachable models. Any lazy loading reference you have with your hibernate objects, needs an open hibernate session, while you should return (close) the hibernate session after each request.

And which render strategy do you use? The 'REDIRECT_TO_RENDER' strategy (not the default anymore) could cause problems with Hibernate session, as you might load an object in the action part of the request, and render that object in the render part (which is a seperate request). See also the javadocs in ApplicationSettings.

Eelco


叶卫国 wrote:

Caused by: org.hibernate.LazyInitializationException: could not initialize 
proxy - the owning Session was closed


I use wicket+spring+hibernate. this is the code snippet:

public class NewsDAOHibernate extends HibernateDaoSupport implements NewsDAO {

 public void add(News news) {
     super.getHibernateTemplate().save(news);
 }

 public void update(News news) {
     super.getHibernateTemplate().update(news);
 }

 public void delete(News news) {
     super.getHibernateTemplate().delete(news);
 }

 public News fetch(Long newsId) {
     return (News) super.getHibernateTemplate().load(News.class, newsId);
 }

 public List findByAll() {
     String hsql = "from News";
     return super.getHibernateTemplate().find(hsql);
 }
public List findByShop(Shop shop) {
     String hsql = "from News as news where news.shop = ?";
     return super.getHibernateTemplate().find(hsql, shop);
 }

}

        

          2005-06-17
HS^甸殜X?'矈辵純娗(疥膉虌妠?j亘?+kj谞夒畨?羈澺"殭^秶钖Z0F啙櫔l糙趭m~婐j穁湑?"濟+櫕b藉瀖片镀j+xg瓃鳙守b?
êw瀡? 
z郓秼)y鏮j薬囤l⑶gr壙i貪卷〆∪?^鱦)蓃EG谦櫒x%娝V壣峨甔?(悍~娻zw瓎踚??鍔薼矉玵玷?咤娝l?)撸?"rG谦

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,


informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
= = = = = = = = = = = = = = = = = = = =
                        
        叶卫国
[EMAIL PROTECTED]
          2005-06-17

HS^甸殜X?'矈辵純娗(疥膉虌妠?j亘?+kj谞夒畨?羈澺"殭^秶钖Z0F啙櫔l糙趭m~婐j穁湑?"濟+櫕b藉瀖片镀j+xg瓃鳙守b?
êw瀡? 
z郓秼)y鏮j薬囤l⑶gr壙i貪卷〆∪?^鱦)蓃EG谦櫒x%娝V壣峨甔?(悍~娻zw瓎踚??鍔薼矉玵玷?咤娝l?)撸?"rG谦

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

= = = = = = = = = = = = = = = = = = = =
                        
        叶卫国
[EMAIL PROTECTED]
          2005-06-17

HS^甸殜X�'矈辵純娗(疥膉虌妠�j亘�+kj谞夒畨�羈澺"殭^秶钖Z0F啙櫔l糙趭m~婐j穁湑�"濟+櫕b藉瀖片镀j+xg瓃鳙守b�êw瀡� 
z郓秼)y鏮j薬囤l⑶gr壙i貪卷〆∪�^鱦)蓃EG谦櫒x%娝V壣峨甔�(悍~娻zw瓎踚��鍔薼矉玵玷�咤娝l⺋)撸�"rG谦




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to