-->
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.  [ 12 posts ] 
Author Message
 Post subject: org.hibernate.LazyInitializationException: failed to lazily
PostPosted: Wed Apr 30, 2008 6:19 am 
Newbie

Joined: Wed Apr 30, 2008 6:13 am
Posts: 11

Hi all,

I am facing problem in hibernate.When i am trying to get a collection of objects in spring i am getting this LazyInitializationException.I have attached the full stacktrace below.Can anybody please help me on this:


07:01:48,407 ERROR [LazyInitializationException] failed to lazily initialize a collection of role: com.ifs.app.model.adaptors.ScheduleGroupAdaptor.vendorServiceTransports, no session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.ifs.app.model.adaptors.ScheduleGroupAdaptor.vendorServiceTransports, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
at org.hibernate.collection.PersistentSet.toString(PersistentSet.java:253)
at com.ifs.vendor.service.scheduler.UpdateScheduleJobHandler.execute(UpdateScheduleJobHandler.java:72)
at com.ifs.vendor.service.scheduler.UpdateScheduleJob.execute(UpdateScheduleJob.java:44)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
07:01:51,080 ERROR [LazyInitializationException] failed to lazily initialize a collection of role: com.ifs.app.model.adaptors.ScheduleGroupAdaptor.vendorServiceTransports, no session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.ifs.app.model.adaptors.ScheduleGroupAdaptor.vendorServiceTransports, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
at org.hibernate.collection.PersistentSet.iterator(PersistentSet.java:138)
at com.ifs.vendor.service.scheduler.UpdateScheduleJobHandler.execute(UpdateScheduleJobHandler.java:72)
at com.ifs.vendor.service.scheduler.UpdateScheduleJob.execute(UpdateScheduleJob.java:44)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
07:02:05,241 INFO [STDOUT] org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.ifs.app.model.adaptors.ScheduleGroupAdaptor.vendorServiceTransports, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
at org.hibernate.collection.PersistentSet.iterator(PersistentSet.java:138)
at com.ifs.vendor.service.scheduler.UpdateScheduleJobHandler.execute(UpdateScheduleJobHandler.java:72)
at com.ifs.vendor.service.scheduler.UpdateScheduleJob.execute(UpdateScheduleJob.java:44)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)





This is my hibernate file:



<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.ifs.app.model.adaptors.ScheduleGroupAdaptor" table="schedule_group" lazy="true">
<id name="scheduleGroupId" type="java.lang.Integer" column="SCHEDULE_GROUP_ID">
<generator class="increment"/>
</id>
<property name="groupName" type="java.lang.String" column="GROUP_NAME" not-null="false" length="60"/>
<set name="vendorServiceTransports" lazy="true" inverse="true" cascade="all" order-by="VENDOR_SRV_TPT_ID">
<key>
<column name="SCHEDULE_GROUP_ID"/>
</key>
<one-to-many class="com.ifs.app.model.adaptors.VendorServiceTransportAdaptor"/>
</set>
</class>
</hibernate-mapping>[/b]


Top
 Profile  
 
 Post subject: questions
PostPosted: Wed Apr 30, 2008 7:49 am 
Senior
Senior

Joined: Sun Jun 11, 2006 10:41 am
Posts: 164
Hi,
1. Pls post the code that gets the entity from hibernate
2. pls post the code that generates the exception
Without those, my first guess is that you are maybe trying to access the property from a client after it has been queried off a database on the server and passed back to the client.

There is also a slight discrepency between the EJB 3.0 spec and hibernate which may be relevant to your case (regardless of whether you use EJBs or not). See my post about it here:
http://forum.hibernate.org/viewtopic.php?t=985531

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 30, 2008 8:08 am 
Newbie

Joined: Wed Apr 30, 2008 6:13 am
Posts: 11
HI

thnx for ur quick reply.I am attaching all my files relaed to this issue and explaining all these below.

VendorServiceTransport.hbm.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class
name="com.ifs.app.model.adaptors.VendorServiceTransportAdaptor"
table="vendor_service_transport" lazy="true">
<id name="vendorSrvTptId" type="java.lang.Integer"
column="VENDOR_SRV_TPT_ID">
<generator class="increment" />
</id>
<property name="syncEnabled" type="java.lang.Integer"
column="SYNC_ENABLED" not-null="false" length="1" />
<property name="scheduleEnabled" type="java.lang.Integer"
column="SCHEDULE_ENABLED" not-null="false" length="1" />
<property name="markedForDelete" type="java.lang.Integer"
column="MARKED_FOR_DELETE" not-null="false" length="1" />
<many-to-one name="transport"
class="com.ifs.app.model.adaptors.TransportAdaptor"
not-null="false">
<column name="TRANSPORT_ID" />
</many-to-one>
<many-to-one name="responseTransportId"
class="com.ifs.app.model.adaptors.TransportAdaptor"
not-null="false">
<column name="RESPONSE_TRANSPORT_ID" />
</many-to-one>

<many-to-one name="vendorService"
class="com.ifs.app.model.adaptors.VendorServiceAdaptor"
not-null="false">
<column name="VENDOR_SERVICE_ID" />
</many-to-one>

<many-to-one name="scheduleGroup"
class="com.ifs.app.model.adaptors.ScheduleGroupAdaptor"
not-null="false">
<column name="SCHEDULE_GROUP_ID" />
</many-to-one>
<many-to-one name="encryptAlgo"
class="com.ifs.app.model.adaptors.EncryptAlgoAdaptor"
not-null="false">
<column name="ENCRYPT_ALGO_ID" />
</many-to-one>
<set name="configDatas" lazy="true" inverse="true" cascade="all"
order-by="CONFIG_DATA_ID">
<key>
<column name="VENDOR_SRV_TPT_ID" />
</key>
<one-to-many
class="com.ifs.app.model.adaptors.ConfigDataAdaptor" />
</set>
</class>
</hibernate-mapping>






VendorService.hbm.xml

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.ifs.app.model.adaptors.VendorServiceAdaptor"
table="vendor_service" lazy="true">
<id name="vendorServiceId" type="java.lang.Integer"
column="VENDOR_SERVICE_ID">
<generator class="increment" />
</id>
<property name="serviceHandler" type="java.lang.String"
column="SERVICE_HANDLER" not-null="false" length="256" />
<property name="responseHandler" type="java.lang.String"
column="RESPONSE_HANDLER" not-null="false" length="256" />
<many-to-one name="vendors"
class="com.ifs.app.model.adaptors.VendorsAdaptor" not-null="true">
<column name="VENDOR_ID" />
</many-to-one>
<many-to-one name="formatDesc"
class="com.ifs.app.model.adaptors.FormatDescAdaptor"
not-null="true">
<column name="FORMAT_ID" />
</many-to-one>
<many-to-one name="serviceDesc"
class="com.ifs.app.model.adaptors.ServiceDescAdaptor"
not-null="true">
<column name="SERVICE_ID" />
</many-to-one>

<property name="markedForDelete" type="java.lang.Integer"
column="MARKED_FOR_DELETE" not-null="false" length="1" />

<one-to-one name="vendorServiceTransport"
class="com.ifs.app.model.adaptors.VendorServiceTransportAdaptor" outer-join="auto"
property-ref="vendorService" />


<!--<set name="vendorServiceTransports" lazy="true" inverse="true"
cascade="all" where="MARKED_FOR_DELETE=0"
order-by="VENDOR_SRV_TPT_ID">
<key>
<column name="VENDOR_SERVICE_ID" />
</key>
<one-to-many
class="com.ifs.app.model.adaptors.VendorServiceTransportAdaptor" />
</set>


--><set name="vendorSubservices" lazy="true" inverse="true"
cascade="all" where="MARKED_FOR_DELETE=0"
order-by="VENDOR_SUBSERVICE_ID">
<key>
<column name="VENDOR_SERVICE_ID" />
</key>
<one-to-many
class="com.ifs.app.model.adaptors.VendorSubserviceAdaptor" />
</set>
</class>
</hibernate-mapping>



VendorService.java(Entity)

package com.ifs.app.model.entities;

import java.io.Serializable;
import java.util.Set;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

public class VendorService extends com.ifs.app.model.BaseDomain implements
Serializable {

private Integer vendorServiceId;

private com.ifs.app.model.entities.Vendors vendors;

private com.ifs.app.model.entities.FormatDesc formatDesc;

private com.ifs.app.model.entities.ServiceDesc serviceDesc;

private String serviceHandler;

private String responseHandler;

private Set vendorSubservices;

private com.ifs.app.model.entities.VendorServiceTransport vendorServiceTransport;

private Integer markedForDelete;

/** full constructor */
public VendorService(Integer vendorServiceId,
com.ifs.app.model.entities.Vendors vendors,
com.ifs.app.model.entities.FormatDesc formatDesc,
com.ifs.app.model.entities.ServiceDesc serviceDesc,
String responseHandler, String serviceHandler,
com.ifs.app.model.entities.VendorServiceTransport vendorServiceTransport, Set vendorSubservices,
Integer markedForDelete) {
this.vendorServiceId = vendorServiceId;
this.vendors = vendors;
this.formatDesc = formatDesc;
this.serviceDesc = serviceDesc;
this.vendorServiceTransport = vendorServiceTransport;
this.serviceHandler = serviceHandler;
this.responseHandler = responseHandler;
this.vendorSubservices = vendorSubservices;
this.markedForDelete = markedForDelete;
}

/** default constructor */
public VendorService() {
}

/** minimal constructor */
public VendorService(Integer vendorServiceId,
com.ifs.app.model.entities.Vendors vendors,
com.ifs.app.model.entities.FormatDesc formatDesc,
com.ifs.app.model.entities.ServiceDesc serviceDesc,
com.ifs.app.model.entities.VendorServiceTransport vendorServiceTransport, Set vendorSubservices) {
this.vendorServiceId = vendorServiceId;
this.vendors = vendors;
this.formatDesc = formatDesc;
this.serviceDesc = serviceDesc;
this.vendorServiceTransport = vendorServiceTransport;
this.vendorSubservices = vendorSubservices;

}

public Integer getVendorServiceId() {
return this.vendorServiceId;
}

public void setVendorServiceId(Integer vendorServiceId) {
this.vendorServiceId = vendorServiceId;
}

public com.ifs.app.model.entities.Vendors getVendors() {
return this.vendors;
}

public void setVendors(com.ifs.app.model.entities.Vendors vendors) {
this.vendors = vendors;
}

public com.ifs.app.model.entities.FormatDesc getFormatDesc() {
return this.formatDesc;
}

public void setFormatDesc(com.ifs.app.model.entities.FormatDesc formatDesc) {
this.formatDesc = formatDesc;
}

public String getResponseHandler() {
return this.responseHandler;
}

public void setResponseHandler(String responseHandler) {
this.responseHandler = responseHandler;
}

public com.ifs.app.model.entities.ServiceDesc getServiceDesc() {
return this.serviceDesc;
}

public void setServiceDesc(
com.ifs.app.model.entities.ServiceDesc serviceDesc) {
this.serviceDesc = serviceDesc;
}

public String getServiceHandler() {
return this.serviceHandler;
}

public void setServiceHandler(String serviceHandler) {
this.serviceHandler = serviceHandler;
}

public Set getVendorSubservices() {
return this.vendorSubservices;
}

public void setVendorSubservices(Set vendorSubservices) {
this.vendorSubservices = vendorSubservices;
}

public String toString() {
return new ToStringBuilder(this).append("vendorServiceId",
getVendorServiceId()).toString();
}

public boolean equals(Object other) {
if ((this == other))
return true;
if (!(other instanceof VendorService))
return false;
VendorService castOther = (VendorService) other;
return new EqualsBuilder().append(this.getVendorServiceId(),
castOther.getVendorServiceId()).isEquals();
}

public int hashCode() {
return new HashCodeBuilder().append(getVendorServiceId()).toHashCode();
}



public com.ifs.app.model.entities.VendorServiceTransport getVendorServiceTransport() {
return vendorServiceTransport;
}

public void setVendorServiceTransport(
com.ifs.app.model.entities.VendorServiceTransport vendorServiceTransport) {
this.vendorServiceTransport = vendorServiceTransport;
}

/**
* @return Returns the markedForDelete.
*/
public Integer getMarkedForDelete() {
return markedForDelete;
}

/**
* @param markedForDelete
* The markedForDelete to set.
*/
public void setMarkedForDelete(Integer markedForDelete) {
this.markedForDelete = markedForDelete;
}
}


VendorServiceTransport.java(Entity)
package com.ifs.app.model.entities;

import java.io.Serializable;
import java.util.Set;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

public class VendorServiceTransport extends com.ifs.app.model.BaseDomain
implements Serializable {

private Integer vendorSrvTptId;

private com.ifs.app.model.entities.Transport transport;

private com.ifs.app.model.entities.VendorService vendorService;

private com.ifs.app.model.entities.ScheduleGroup scheduleGroup;

private com.ifs.app.model.entities.Transport responseTransportId;

private Integer markedForDelete;

private Integer syncEnabled;

private com.ifs.app.model.entities.EncryptAlgo encryptAlgo;

private Integer scheduleEnabled;

private Set configDatas;

/** full constructor */
public VendorServiceTransport(Integer vendorSrvTptId,
com.ifs.app.model.entities.Transport transport,
com.ifs.app.model.entities.VendorService vendorService,
com.ifs.app.model.entities.ScheduleGroup scheduleGroup,
com.ifs.app.model.entities.Transport responseTransportId,
Integer markedForDelete,
com.ifs.app.model.entities.EncryptAlgo encryptAlgo,
Integer scheduleEnabled, Integer syncEnabled, Set configDatas) {
this.vendorSrvTptId = vendorSrvTptId;
this.transport = transport;
this.vendorService = vendorService;
this.scheduleGroup = scheduleGroup;
this.responseTransportId = responseTransportId;
this.markedForDelete = markedForDelete;
this.encryptAlgo = encryptAlgo;
this.scheduleEnabled = scheduleEnabled;
this.syncEnabled = syncEnabled;
this.configDatas = configDatas;

}

/** default constructor */
public VendorServiceTransport() {
}

/** minimal constructor */
public VendorServiceTransport(Integer vendorSrvTptId, Set configDatas) {
this.vendorSrvTptId = vendorSrvTptId;
this.configDatas = configDatas;

}

public Integer getVendorSrvTptId() {
return this.vendorSrvTptId;
}

public void setVendorSrvTptId(Integer vendorSrvTptId) {
this.vendorSrvTptId = vendorSrvTptId;
}

public com.ifs.app.model.entities.Transport getResponseTransportId() {
return this.responseTransportId;
}

public void setResponseTransportId(
com.ifs.app.model.entities.Transport responseTransportId) {
this.responseTransportId = responseTransportId;
}

public com.ifs.app.model.entities.Transport getTransport() {
return this.transport;
}

public void setTransport(com.ifs.app.model.entities.Transport transport) {
this.transport = transport;
}

public com.ifs.app.model.entities.VendorService getVendorService() {
return this.vendorService;
}

public void setVendorService(
com.ifs.app.model.entities.VendorService vendorService) {
this.vendorService = vendorService;
}

public com.ifs.app.model.entities.ScheduleGroup getScheduleGroup() {
return this.scheduleGroup;
}

public void setScheduleGroup(
com.ifs.app.model.entities.ScheduleGroup scheduleGroup) {
this.scheduleGroup = scheduleGroup;
}

public Integer getMarkedForDelete() {
return this.markedForDelete;
}

public void setMarkedForDelete(Integer markedForDelete) {
this.markedForDelete = markedForDelete;
}

public Integer getSyncEnabled() {
return this.syncEnabled;
}

public void setSyncEnabled(Integer syncEnabled) {
this.syncEnabled = syncEnabled;
}

public Set getConfigDatas() {
return this.configDatas;
}

public void setConfigDatas(Set configDatas) {
this.configDatas = configDatas;
}

public com.ifs.app.model.entities.EncryptAlgo getEncryptAlgo() {
return this.encryptAlgo;
}

public void setEncryptAlgo(
com.ifs.app.model.entities.EncryptAlgo encryptAlgo) {
this.encryptAlgo = encryptAlgo;
}

public Integer getScheduleEnabled() {
return this.scheduleEnabled;
}

public void setScheduleEnabled(Integer scheduleEnabled) {
this.scheduleEnabled = scheduleEnabled;
}

public String toString() {
return new ToStringBuilder(this).append("vendorSrvTptId",
getVendorSrvTptId()).toString();
}

public boolean equals(Object other) {
if ((this == other))
return true;
if (!(other instanceof VendorServiceTransport))
return false;
VendorServiceTransport castOther = (VendorServiceTransport) other;
return new EqualsBuilder().append(this.getVendorSrvTptId(),
castOther.getVendorSrvTptId()).isEquals();
}

public int hashCode() {
return new HashCodeBuilder().append(getVendorSrvTptId()).toHashCode();
}
}




Below Is the code Where i am trying to get the collections from the Object

Set vendorServiceTransports = this.scheduleGroupAdaptor
.getVendorServiceTransports();
Iterator itr = vendorServiceTransports.iterator();





I have attached all my related files related to this issue.If u want anything sles plz revert me back.Once again thnx a lot for the reply

Regards
Deba


Top
 Profile  
 
 Post subject: more info please
PostPosted: Wed Apr 30, 2008 11:48 am 
Senior
Senior

Joined: Sun Jun 11, 2006 10:41 am
Posts: 164
Hi,
1. What part of the code throws the exception? the attempt to retreive an iterator?
2. where is the code behind .scheduleGroupAdaptor
.getVendorServiceTransports(), which returns the actual lazy set?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 01, 2008 12:59 am 
Newbie

Joined: Wed Apr 30, 2008 6:13 am
Posts: 11
YA when i am trying to iterate the Set its throwing that exception....Please help me on that..its urgent for me..please


anyway thnx for ur reply

Regards
Debapriya


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 01, 2008 2:16 am 
Regular
Regular

Joined: Mon Aug 06, 2007 10:49 am
Posts: 67
Location: Banska Bystrica, Slovakia
read this:

http://www.hibernate.org/hib_docs/v3/re ... ching-lazy


Top
 Profile  
 
 Post subject: missing info
PostPosted: Thu May 01, 2008 6:24 am 
Senior
Senior

Joined: Sun Jun 11, 2006 10:41 am
Posts: 164
Hi,
As I asked earlier, can u pls post the code behind .scheduleGroupAdaptor
.getVendorServiceTransports(), which returns the actual lazy set?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 01, 2008 6:30 am 
Newbie

Joined: Wed Apr 30, 2008 6:13 am
Posts: 11
ya i have gone through this but, i didn't get the solution for this Exception....anyway..


thnx...


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 02, 2008 2:14 am 
Senior
Senior

Joined: Mon Feb 25, 2008 1:48 am
Posts: 191
Location: India
This exception occurs when you try to do a lazy initialization outside the session scope. Make sure the session is open when you try to iterate the set.

_________________
Sukirtha


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 02, 2008 11:57 am 
Newbie

Joined: Mon Apr 28, 2008 4:14 pm
Posts: 5
Hi,

Log your object right after fetching it from database. This is quick and dirty solution.

For best solution you have make your method transactional.

See transaction support of spring.


anurag


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2008 6:44 am 
Newbie

Joined: Fri Dec 12, 2008 6:24 am
Posts: 1
I also faced this problem
The reason I found out was that in my web.xml I had commented the below filter name & mapping

<filter>
<filter-name>openSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>openSessionInViewFilter</filter-name>
<servlet-name>action</servlet-name>
</filter-mapping>

so it was giving the session timed out problem
I uncommented it & my code ran perfectly


Top
 Profile  
 
 Post subject: Re: org.hibernate.LazyInitializationException: failed to lazily
PostPosted: Sun Aug 23, 2009 7:22 am 
Newbie

Joined: Sun Aug 23, 2009 7:17 am
Posts: 2
Hello Guys..Use the below bean tag 'openSessionInViewInterceptor'
<bean id="openSessionInViewInterceptor" class="org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor">
<property name="sessionFactory">
<ref bean="factory" />
</property>
<property name="singleSession" value="true"/>
<property name="flushModeName">
<value>FLUSH_AUTO</value>
</property>

</bean>

<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="interceptors">
<list>
<ref bean="loginInterceptor"/>
<ref bean="openSessionInViewInterceptor"/>
</list>
</property>
<property name="mappings">
<props>
<prop key="/login.do">logginController</prop>

</props>
</property>
</bean>

<bean id="factory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="mappingResources">
<list>
<value>history.hbm.xml</value>
<value>personnalHealth.hbm.xml</value>
<value>educationaExpl.hbm.xml</value>
<value>abroadExp.hbm.xml</value>
<value>workExp.hbm.xml</value>
<value>homeAssetsHist.hbm.xml</value>
<value>contactlist.hbm.xml</value>
<value>interests.hbm.xml</value>
<value>officeAssets.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
<property name="dataSource">
<ref bean="dataSource"/>
</property>
</bean>
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName">
<value>org.hsqldb.jdbcDriver</value>
</property>
<property name="url">
<value>jdbc:hsqldb:hsql://localhost:8887</value>
</property>
<property name="username">
<value>sa</value>
</property>
<property name="password">
<value></value>
</property>
</bean>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 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.