-->
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.  [ 1 post ] 
Author Message
 Post subject: lazy instantiation problem
PostPosted: Tue Jun 14, 2005 7:11 am 
Newbie

Joined: Tue Jun 14, 2005 7:01 am
Posts: 1
Can somebody help me I'm having a

net.sf.hibernate.LazyInitializationException: Hibernate lazy instantiation problem

Since my junit tests doesnt fail. I think that the answer of my problem lies with the J2ee container.

I'm using JBoss 4sp1, Hibernate 2.1 and xdoclet1.2.2 and a MySql DB, below is my msql-ds.xml

<?xml version="1.0" encoding="UTF-8"?>

<datasources>
<local-tx-datasource>
<jndi-name>MySqlDS</jndi-name>
<connection-url>jdbc:mysql://server:3306/les</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
<password>root</password>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<track-statements>false</track-statements>
<min-pool-size>10</min-pool-size>
<max-pool-size>30</max-pool-size>
<blocking-timeout-millis>10000</blocking-timeout-millis>
<idle-timeout-minutes>15</idle-timeout-minutes>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
<check-valid-connection-sql>select LAST_INSERT_ID()</check-valid-connection-sql>
<metadata>
<type-mapping>mySQL</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>


and here is the code from my sessionbean (just in case...)



/**
* @throws Exception
* @ejb.interface-method view-type="local"
*/
public List getAllJournals() {
logger.info("getAllJournals method called.");
return (List) HibernateRunner.executeWrapCheckedExceptions(new HibernateTemplate() {

public Object execute(Session session) throws Exception {
return session.find("from " + Journal.class.getName());
}

});
}


I have posted this question on the jboss forum and didn't get any help there, so some help would be welcome.

Thanks and sorry for my the poor english ;-)


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

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.