Add this to the session factory bean (mySessionFactory).
Add this to the session factory bean (mySessionFactory): false And then see explanation in theresearchkitchen.com/blog/archives/73.
This works but one thing: If I use the Spring managed transactions, I receive this exception too. – asrijaal Nov 30 '09 at 13:42 Think I've got it: hibernate. Current_session_context_class=thread wasn't set in my config, thats why it doesn't worked with spring managed transactions.
– asrijaal Nov 30 '09 at 13:52 SessionFactory is created, my bean too. But no query gets executed, am I missing something else? – asrijaal Nov 30 '09 at 14:44.
You should be using "getCurrentSession()" to get the session, or better still extend spring's bernateDAOSupport for your dto's. Your config is the same as one we used on a recent project and had none of the issues you're having. Did not have to do any more configuration than you've shown in your original question.
We did however always extend bernateDAOSupport in our DAO's. And we were also on Jboss. I'm not sure you should be setting that property to false (exposeTransactionAwareSessionFactory) - it should work without it.
I've found the javadocs for LocalSessionFactoryBean to be particularly helpful.
I'm using the "getCurrentSession()" method, I'll extend my DAO with the bernateDAOSupport and test it. I've encountered another problem/exception: Proxy$xx cannot be cast against DomainP1Impl - well it is programmed againt an interface so I don't really know whats going wrong here. – asrijaal Nov 30 '09 at 19:36.
No query gets executed because your datasources are all screwed up ds1Datasource and db2Datasource.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.