-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Loss of Data in transactions in the hibernate
PostPosted: Thu Feb 26, 2009 9:23 am 
Newbie

Joined: Thu Feb 26, 2009 7:57 am
Posts: 2
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
Hibernate 3.1

Mapping documents:
Hibernate Mapping DTD 3.0

Code between sessionFactory.openSession() and session.close():
/**
* Retrieves the current Session local to the thread.
* <p/>
* If no Session is open, opens a new Session for the running thread.
*
* @return Session
*/
public static Session getSession(String ref) throws InfrastructureException {
Session s = (Session)threadSession.get();
try {
if (s == null) {
if (logger.isDebugEnabled())
logger.debug("Opening new Session for this thread. - " + ref);
if (getInterceptor() != null) {
if (logger.isDebugEnabled())
logger.debug("Using interceptor: " + getInterceptor().getClass());
s = getSessionFactory().openSession(getInterceptor());
} else {
s = getSessionFactory().openSession();
}
threadSession.set(s);
}
} catch (Exception ex) {
throw new InfrastructureException(ex);
}
return s;
}

/**
* Closes the Session local to the thread.
*/
public static void closeSession(long transactionId, String ref) throws InfrastructureException {
if (isStarterTransactionId(transactionId)) {
try {
Session s = (Session)threadSession.get();
threadSession.set(null);
if (s != null && s.isOpen()) {
if (logger.isDebugEnabled())
logger.debug("Closing Session of this thread. - " + ref);
s.close();
}
} catch (HibernateException ex) {
throw new InfrastructureException(ex);
}
}
}

Full stack trace of any exception that occurs:

Name and version of the database you are using:
PostgreSQL 8.3


Problems with Session and transaction handling?
Yes

---------------#####------------
Hi,

Personnel is with a great problem in my application...
It is the following I am using the group Windows Server 2003 + Windows Terminal Service, PostgreSQL 8.3 and Hibernate 3.1 and it is happening that in intervals of 3 days on average,
some transactions don't happen, in other words,
I have a cadaster of patients and of attendances, the one where the patients are registered and if everything happens correctly (without any exception)
the program reads the registered patient and he/she allows to do the attendance for him, each operation with your transaction in separate,
happen that once in a while the patient that was to be registered it is not simply,
but in the program he/she didn't give any mistake or it didn't still fall in any exception, I placed messages in a log file, to identify after the commit,
that he really went by the that code line, and he passes, but from time to time him non sage, before I used Firebird,
now I changed for PostgreSQL thinking it was problem of the database, and anything, somebody knows me to say if I have q to alter some configuration of Hibernate, or still if
the possibility exists of some bug in the hibernate,

Respectfully, Anderson




Read this: http://hibernate.org/42.html


Last edited by andersonpalhano on Thu Feb 26, 2009 1:26 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Loss of Data in transactions in the hibernate
PostPosted: Thu Feb 26, 2009 1:23 pm 
Newbie

Joined: Thu Feb 26, 2009 7:57 am
Posts: 2
Hibernate version:
Hibernate 3.1


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.