Thanks for your
reply
i want to discuss with you
of the making of HibernateUtil class
i declare in the HibernateUtil class
Code:
private static final ThreadLocal<Session> threadLocal = new ThreadLocal<Session>();
that is right
from that code we generate a particular session for each thread
that sounds good by using ThreadLocal class
but i saw
another declaration
Code:
private static final ThreadLocal threadTransaction =new ThreadLocal();
that code is generate one transaction for particular thread
that sounds, little bit confuse me
suppose if thread first goes to save the data
but first it delete the data
then it save
then for all sql operation the one transaction is used
is it right
suppose transaction executes a long batch of query
why not consider a separate transaction
for each operation in the database
like save() or delete() or find by id()
means
for save operation
Transaction tx=session.beginTransaction()
getting the session
doing the database operation
then commit the transaction
same for delete
in the first case
for
one request
one session
one transaction
in second case
for
one request
one session
multiple transaction
can transaction should be unique for one request
ya i have one more question
do i need for setting the transaction
isolation
or
can i use default hibernate transaction isolation