• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Hibernate Session problem  RSS feed

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used hibernate for the web app

every time i perform a database transaction with the same arguments I get different data and some data on the session disappears i get null pointer exception
what could be the problem

<session-factory>
<property name="dialect">
org.hibernate.dialect.Oracle9Dialect
</property>
<property name="connection.url">
jdbcracle:thin:@10.11.45.200:1521rcl
</property>
<property name="connection.username">cert</property>
<property name="connection.password">cert</property>
<property name="connection.driver_class">
oracle.jdbc.driver.OracleDriver
</property>
<property name="myeclipse.connection.profile">CertDB</property>
<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">10</property>

<property name="current_session_context_class">thread</property>

<property name="hibernate.cache.use_second_level_cache">false</property>


<property name="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</property>




<property name="show_sql">true</property>
<property name="hbm2ddl.auto">validate</property>





<property name="cache.provider_class">
org.hibernate.cache.NoCacheProvider
</property>

<property name="show_sql">true</property>
<property name="hbm2ddl.auto">validate</property>

<property name="hibernate.jdbc.batch_size">20</property>





<mapping resource="map/ServerSites.hbm.xml" /


______________public T getById(Serializable simpleId) {
Session sess = getSession();
Transaction tx = null;
try {
tx = sess.beginTransaction();
T obj = (T) sess.load(getEntityClass(), simpleId);

tx.commit();
return obj;
} catch (Exception e) {

if (tx != null) {
tx.rollback();
}
return null;
} finally {
sess.close();
closeSession();
}
}
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!