• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help using filters with Hibernate

 
Jehan Jaleel
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am using a filter with hibernate. In my hbm file I have the following code....



Then in my code I am enabling my filter with the following....


But I am getting the following exception



Thanks for any help.
 
Francois Nadeau
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jehan,

Did you define your filter?



Cheers
 
Jehan Jaleel
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks I think that was my issue.

But now there is another problem. In my code I am calling the filter through Spring's getHibernateTemplate() method....



but it throws this exception.....

 
Francois Nadeau
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Am not an expert in Spring, but I think you need to either use a transaction, HibernateInterceptor, or OpenSessionInViewFilter.

You should be able to find code samples of this if you google around.

Cheers.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic