I have this JEE web application where if I check the tutor is not there then proceed to register the tutor follows by the subject.
So, in this case how do I use the SessionFactory and session such that I will not get the following error
INFO [http-nio-8080-exec-1]: SessionFactory created.
INFO [http-nio-8080-exec-1]: this is an error
java.lang.IllegalStateException: Transaction already active
at org.hibernate.engine.transaction.internal.TransactionImpl.begin(TransactionImpl.java:52)
at Business.RegisterService.isTutorExists(RegisterService.java:109)
at Business.RegisterService.register(RegisterService.java:30)
at controller.tutorController.doPost(tutorController.java:85)
And I am getting the same error for the inserting subjects…
Because open the sessionFactory and close it on each of the methods does not work
Does using Spring framework helps in my case?
I am a noob in Spring framework. And I am using Eclipse. Is there just a small library that is SessionFactory for hibernate that I can download and work from there ?
I’d appreciate it if you could point me to a easy to learn tutorial and it has to be maven JPA JEE.
Thanks.