Jun 7th, 2011, 01:52 AM
How to use ejb 3 in spring 3
I am beginner to spring and currently i am involved in application design of our project.
We are using spring 3 and hibernate(not spring hibernate). We build sessionfactory on run time and store in a hashMap and then retrieve session from those stored sessionfactory.
I want to add transaction management utilities. I shortlisted ejb, hibernate and spring 3. I cannot use spring transaction since i dont have datasource. My sessionFactory is generated at run time as stated above.
I cannot use hibernate transactions because there are many databases and transaction strategies for them is different.
So i decided to go for EJB 3. My flow is, Using sessionbeans i will be calling dao methods in which hibernate code is situated.
And on those methods (methods of EJB)i will be adding transaction strategies.
I want to wire EJB 3(session bean) with spring 3
Please tell me how can i add transaction strategies to the methods and if my design is right.
I dont even know if i am posting this question in right forum
Its been 2 days now and i really dont have any clue which way to proceed
Thanks in advance