-->
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.  [ 10 posts ] 
Author Message
 Post subject: Springs open another session in my current Session
PostPosted: Fri May 28, 2004 9:23 am 
Regular
Regular

Joined: Wed Apr 21, 2004 10:57 am
Posts: 62
Location: Hasselt, Belgium
I've been playing a bit more with Spring and found it super. Looking on my debug log gave me some rather strange behavior. Does anyone know if this is normal behavior or is there still some error in my application.

If I perform several testcases at once he does the following things.

Code:
[15:13:47,812] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Using transaction object [org.springframework.orm.hibernate.HibernateTransactionObject@54ea79]
[15:13:47,828] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Creating new transaction
[15:13:47,828] DEBUG org.springframework.orm.hibernate.SessionFactoryUtils  - Opening Hibernate session
[15:13:47,843] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Opened new session [net.sf.hibernate.impl.SessionImpl@6dd9b3] for Hibernate transaction
[15:13:47,859] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Beginning Hibernate transaction on session [net.sf.hibernate.impl.SessionImpl@6dd9b3]
[15:13:47,859] DEBUG be.ngb.dao.HibernateGebruikerDAO  - Create gebruiker: Gebruiker [id:null-naam:naam-paswoord:paswoord]
[15:13:47,875] DEBUG org.springframework.orm.hibernate.SessionFactoryUtils  - Opening Hibernate session
[15:13:47,875] DEBUG org.springframework.orm.hibernate.SessionFactoryUtils  - Registering Spring transaction synchronization for Hibernate session
[15:13:47,890] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Triggering beforeCommit synchronization
[15:13:47,906] DEBUG org.springframework.orm.hibernate.SessionFactoryUtils  - Flushing Hibernate session on transaction synchronization
[15:13:47,921] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Triggering beforeCompletion synchronization


Note the Opening Hibernate Session being done twice.

But if I run this testcase with only one method alone I get the following.

Code:
[15:18:25,781] INFO  org.springframework.orm.hibernate.LocalSessionFactoryBean  - Building new Hibernate SessionFactory
[15:18:28,062] INFO  org.springframework.orm.hibernate.HibernateTransactionManager  - Using DataSource [org.apache.commons.dbcp.BasicDataSource@168fda] from Hibernate SessionFactory for HibernateTransactionManager
[15:18:28,531] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Using transaction object [org.springframework.orm.hibernate.HibernateTransactionObject@4af6c1]
[15:18:28,531] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Creating new transaction
[15:18:28,578] DEBUG org.springframework.orm.hibernate.SessionFactoryUtils  - Opening Hibernate session
[15:18:28,718] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Opened new session [net.sf.hibernate.impl.SessionImpl@aeb74] for Hibernate transaction
[15:18:28,765] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Beginning Hibernate transaction on session [net.sf.hibernate.impl.SessionImpl@aeb74]
[15:18:28,781] DEBUG be.ngb.dao.HibernateGebruikerDAO  - Create gebruiker: Gebruiker [id:null-naam:naam-paswoord:paswoord]
[15:18:28,812] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Triggering beforeCommit synchronization
[15:18:28,812] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Triggering beforeCompletion synchronization


The difference I see is that in the first run the sessionFactory is created in an earlier testcase. Don't know if it has anything to do with it.

The query is performed correctly but I merely wanted to know if this opening the Session twicely was some kind of mistake I made.

Peter


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 28, 2004 11:58 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Check how are you generating the SessionFactory in your test cases. Spring scopes the bound session by a number of things, one of which is the SessionFactory instance.

If it encountered a second instance of SessionFactory, it would open a new session both times (provided both allow creation).


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 01, 2004 2:32 am 
Regular
Regular

Joined: Wed Apr 21, 2004 10:57 am
Posts: 62
Location: Hasselt, Belgium
I found out that in all but one of my testcases the SessionFactory is created at the beginning. In the one that doesn't get a SessionFactory created he opens the Session twice.

I also found out that in my web app the SessionFactory is created a second time during a request/response. Resulting in an error later on. Now I only need to find how to solve it. :) Well, I'll have something new to do today then.

Peter


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 01, 2004 2:39 am 
Regular
Regular

Joined: Wed Apr 21, 2004 10:57 am
Posts: 62
Location: Hasselt, Belgium
GG_Peter wrote:
I found out that in all but one of my testcases the SessionFactory is created at the beginning. In the one that doesn't get a SessionFactory created he opens the Session twice.


It has nothing to do with the double opening so it seems. I merely accessed a BO Impl which already had its sessionFactory build in a previous testcase. Any idea what this is?

Peter


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 01, 2004 2:49 am 
Regular
Regular

Joined: Wed Apr 21, 2004 10:57 am
Posts: 62
Location: Hasselt, Belgium
To clarify my problem a bit. This is what he does at org.springframework.orm debug logging level.

First I do the method testCreateGebruiker in my first testcase. Secondly I do the same method again but in a second testcase this time.

testGebruiker
Code:
[08:42:52,031] INFO  org.springframework.orm.hibernate.LocalSessionFactoryBean  - Building new Hibernate SessionFactory
[08:42:54,484] INFO  org.springframework.orm.hibernate.HibernateTransactionManager  - Using DataSource [org.apache.commons.dbcp.BasicDataSource@305acd] from Hibernate SessionFactory for HibernateTransactionManager
[08:42:54,984] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Using transaction object [org.springframework.orm.hibernate.HibernateTransactionObject@70be88]
[08:42:55,000] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Creating new transaction
[08:42:55,046] DEBUG org.springframework.orm.hibernate.SessionFactoryUtils  - Opening Hibernate session
[08:42:55,218] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Opened new session [net.sf.hibernate.impl.SessionImpl@2c5f13] for Hibernate transaction
[08:42:55,234] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Beginning Hibernate transaction on session [net.sf.hibernate.impl.SessionImpl@2c5f13]
[08:42:55,265] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Triggering beforeCommit synchronization
[08:42:55,281] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Triggering beforeCompletion synchronization
[08:42:55,281] INFO  org.springframework.orm.hibernate.HibernateTransactionManager  - Initiating transaction commit
[08:42:55,312] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Committing Hibernate transaction on session [net.sf.hibernate.impl.SessionImpl@2c5f13]
[08:42:55,531] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Triggering afterCompletion synchronization
[08:42:55,546] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Closing Hibernate session [net.sf.hibernate.impl.SessionImpl@2c5f13] after transaction
[08:42:55,562] DEBUG org.springframework.orm.hibernate.SessionFactoryUtils  - Closing Hibernate session
[08:42:55,562] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Using transaction object [org.springframework.orm.hibernate.HibernateTransactionObject@76f27b]
[08:42:55,578] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Creating new transaction
[08:42:55,578] DEBUG org.springframework.orm.hibernate.SessionFactoryUtils  - Opening Hibernate session
[08:42:55,593] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Opened new session [net.sf.hibernate.impl.SessionImpl@299347] for Hibernate transaction
[08:42:55,609] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Beginning Hibernate transaction on session [net.sf.hibernate.impl.SessionImpl@299347]
[08:42:55,828] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Triggering beforeCommit synchronization
[08:42:55,828] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Triggering beforeCompletion synchronization
[08:42:55,843] INFO  org.springframework.orm.hibernate.HibernateTransactionManager  - Initiating transaction commit
[08:42:55,843] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Committing Hibernate transaction on session [net.sf.hibernate.impl.SessionImpl@299347]
[08:42:55,859] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Triggering afterCompletion synchronization
[08:42:55,875] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Closing Hibernate session [net.sf.hibernate.impl.SessionImpl@299347] after transaction
[08:42:55,890] DEBUG org.springframework.orm.hibernate.SessionFactoryUtils  - Closing Hibernate session


testSysteem
Code:
[08:43:01,390] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Using transaction object [org.springframework.orm.hibernate.HibernateTransactionObject@45e5a6]
[08:43:01,406] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Creating new transaction
[08:43:01,406] DEBUG org.springframework.orm.hibernate.SessionFactoryUtils  - Opening Hibernate session
[08:43:01,421] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Opened new session [net.sf.hibernate.impl.SessionImpl@680761] for Hibernate transaction
[08:43:01,421] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Beginning Hibernate transaction on session [net.sf.hibernate.impl.SessionImpl@680761]
[08:43:01,437] DEBUG org.springframework.orm.hibernate.SessionFactoryUtils  - Opening Hibernate session
[08:43:01,453] DEBUG org.springframework.orm.hibernate.SessionFactoryUtils  - Registering Spring transaction synchronization for Hibernate session
[08:43:01,453] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Triggering beforeCommit synchronization
[08:43:01,515] DEBUG org.springframework.orm.hibernate.SessionFactoryUtils  - Flushing Hibernate session on transaction synchronization
[08:43:01,593] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Triggering beforeCompletion synchronization
[08:43:01,593] INFO  org.springframework.orm.hibernate.HibernateTransactionManager  - Initiating transaction commit
[08:43:01,593] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Committing Hibernate transaction on session [net.sf.hibernate.impl.SessionImpl@680761]
[08:43:01,609] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Triggering afterCompletion synchronization
[08:43:01,609] DEBUG org.springframework.orm.hibernate.SessionFactoryUtils  - Closing Hibernate session
[08:43:01,625] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Closing Hibernate session [net.sf.hibernate.impl.SessionImpl@680761] after transaction
[08:43:01,640] DEBUG org.springframework.orm.hibernate.SessionFactoryUtils  - Closing Hibernate session
[08:43:01,640] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Using transaction object [org.springframework.orm.hibernate.HibernateTransactionObject@391da0]
[08:43:01,656] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Creating new transaction
[08:43:01,656] DEBUG org.springframework.orm.hibernate.SessionFactoryUtils  - Opening Hibernate session
[08:43:01,671] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Opened new session [net.sf.hibernate.impl.SessionImpl@47f37d] for Hibernate transaction
[08:43:01,671] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Beginning Hibernate transaction on session [net.sf.hibernate.impl.SessionImpl@47f37d]
[08:43:01,687] DEBUG org.springframework.orm.hibernate.SessionFactoryUtils  - Opening Hibernate session
[08:43:01,687] DEBUG org.springframework.orm.hibernate.SessionFactoryUtils  - Registering Spring transaction synchronization for Hibernate session
[08:43:01,765] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Triggering beforeCommit synchronization
[08:43:01,781] DEBUG org.springframework.orm.hibernate.SessionFactoryUtils  - Flushing Hibernate session on transaction synchronization
[08:43:01,796] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Triggering beforeCompletion synchronization
[08:43:01,812] INFO  org.springframework.orm.hibernate.HibernateTransactionManager  - Initiating transaction commit
[08:43:01,812] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Committing Hibernate transaction on session [net.sf.hibernate.impl.SessionImpl@47f37d]
[08:43:01,828] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Triggering afterCompletion synchronization
[08:43:01,843] DEBUG org.springframework.orm.hibernate.SessionFactoryUtils  - Closing Hibernate session
[08:43:01,843] DEBUG org.springframework.orm.hibernate.HibernateTransactionManager  - Closing Hibernate session [net.sf.hibernate.impl.SessionImpl@47f37d] after transaction
[08:43:01,875] DEBUG org.springframework.orm.hibernate.SessionFactoryUtils  - Closing Hibernate session


After some other testcases he throws the following exception :
Code:
java.lang.IllegalStateException: No Hibernate Session bound to thread, and configuration does not allow creation of new one here


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 01, 2004 4:33 am 
Regular
Regular

Joined: Wed Apr 21, 2004 10:57 am
Posts: 62
Location: Hasselt, Belgium
Is it normal that a new sessionFactory is created for every BO file I have? Shouldn't there be only one for your complete application?

This is my applicationContext.xml. Does anyone see any mistakes?

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<beans>
   <!--
      Datasource that works in any application server
      You could easily use J2EE data source instead if this were
      running inside of a J2EE container.
    -->
   <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
      <property name="driverClassName"><value>com.mysql.jdbc.Driver</value></property>
      <property name="url"><value>jdbc:mysql:///ngb</value></property>
      <property name="username"><value>root</value></property>
      <property name="password"><value></value></property>
    </bean>

    <!--<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName">
            <value>ngb</value>
        </property>
    </bean>-->

   <!-- Hibernate SessionFactory -->
   <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
      <property name="dataSource"><ref bean="dataSource"/></property>
      <property name="configLocation">
            <value>hibernate.cfg.xml</value>
      </property>
    </bean>

   <!-- Pass the session factory to our DAO's -->
   <bean id="hibernateGebruikerDAO" class="be.ngb.dao.HibernateGebruikerDAO">
      <property name="sessionFactory">
            <ref bean="sessionFactory"/>
        </property>
   </bean>

    <bean id="hibernateKlasseDAO" class="be.ngb.dao.HibernateKlasseDAO">
        <property name="sessionFactory">
            <ref bean="sessionFactory"/>
        </property>
    </bean>

    <bean id="hibernateLandDAO" class="be.ngb.dao.HibernateLandDAO">
        <property name="sessionFactory">
            <ref bean="sessionFactory"/>
        </property>
    </bean>

    <bean id="hibernatePeriodeDAO" class="be.ngb.dao.HibernatePeriodeDAO">
        <property name="sessionFactory">
            <ref bean="sessionFactory"/>
        </property>
    </bean>

    <bean id="hibernatePloegDAO" class="be.ngb.dao.HibernatePloegDAO">
        <property name="sessionFactory">
            <ref bean="sessionFactory"/>
        </property>
    </bean>

    <bean id="hibernatePloegRennerDAO" class="be.ngb.dao.HibernatePloegRennerDAO">
        <property name="sessionFactory">
            <ref bean="sessionFactory"/>
        </property>
    </bean>

    <bean id="hibernateRennerDAO" class="be.ngb.dao.HibernateRennerDAO">
        <property name="sessionFactory">
            <ref bean="sessionFactory"/>
        </property>
    </bean>

    <bean id="hibernateUitslagDAO" class="be.ngb.dao.HibernateUitslagDAO">
        <property name="sessionFactory">
            <ref bean="sessionFactory"/>
        </property>
    </bean>

    <bean id="hibernateWedstrijdDAO" class="be.ngb.dao.HibernateWedstrijdDAO">
        <property name="sessionFactory">
            <ref bean="sessionFactory"/>
        </property>
    </bean>

    <!-- Transaction Management within our BO layer -->
    <bean id="myTransactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager">
       <property name="sessionFactory">
           <ref bean="sessionFactory"/>
       </property>
    </bean>

    <bean id="myTransactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
        <property name="transactionManager">
            <ref bean="myTransactionManager"/>
        </property>
        <property name="transactionAttributeSource">
            <value>
                be.ngb.bo.Gebruiker.create* = PROPAGATION_REQUIRED
                be.ngb.bo.Gebruiker.delete* = PROPAGATION_REQUIRED
                be.ngb.bo.Ploeg.create*     = PROPAGATION_REQUIRED
                be.ngb.bo.Ploeg.delete*     = PROPAGATION_REQUIRED
                be.ngb.bo.Ploeg.update*     = PROPAGATION_REQUIRED
                be.ngb.bo.Ploeg.find*       = PROPAGATION_REQUIRED
                be.ngb.bo.Renner.create*    = PROPAGATION_REQUIRED
                be.ngb.bo.Renner.find*      = PROPAGATION_REQUIRED
                be.ngb.bo.Wedstrijd.create* = PROPAGATION_REQUIRED
                be.ngb.bo.Wedstrijd.delete* = PROPAGATION_REQUIRED
                be.ngb.bo.Wedstrijd.findU*  = PROPAGATION_REQUIRED
            </value>
        </property>
    </bean>

    <bean id="gebruikerImplTarget" class="be.ngb.bo.GebruikerImpl">
        <property name="sessionFactory">
            <ref bean="sessionFactory"/>
        </property>
        <property name="gebruikerDAO">
            <ref bean="hibernateGebruikerDAO"/>
        </property>
    </bean>

    <bean id="gebruikerImpl" class="org.springframework.aop.framework.ProxyFactoryBean">
        <property name="proxyInterfaces">
            <value>be.ngb.bo.Gebruiker</value>
        </property>
        <property name="interceptorNames">
            <list>
                <value>myTransactionInterceptor</value>
                <value>gebruikerImplTarget</value>
            </list>
        </property>
    </bean>

    <bean id="ploegImplTarget" class="be.ngb.bo.PloegImpl">
        <property name="sessionFactory">
            <ref bean="sessionFactory"/>
        </property>
        <property name="ploegDAO">
            <ref bean="hibernatePloegDAO"/>
        </property>
        <property name="ploegRennerDAO">
            <ref bean="hibernatePloegRennerDAO"/>
        </property>
    </bean>

    <bean id="ploegImpl" class="org.springframework.aop.framework.ProxyFactoryBean">
        <property name="proxyInterfaces">
            <value>be.ngb.bo.Ploeg</value>
        </property>
        <property name="interceptorNames">
            <list>
                <value>myTransactionInterceptor</value>
                <value>ploegImplTarget</value>
            </list>
        </property>
    </bean>

    <bean id="rennerImplTarget" class="be.ngb.bo.RennerImpl">
        <property name="sessionFactory">
            <ref bean="sessionFactory"/>
        </property>
        <property name="ploegDAO">
            <ref bean="hibernatePloegDAO"/>
        </property>
        <property name="rennerDAO">
            <ref bean="hibernateRennerDAO"/>
        </property>
    </bean>

    <bean id="rennerImpl" class="org.springframework.aop.framework.ProxyFactoryBean">
        <property name="proxyInterfaces">
            <value>be.ngb.bo.Renner</value>
        </property>
        <property name="interceptorNames">
            <list>
                <value>myTransactionInterceptor</value>
                <value>rennerImplTarget</value>
            </list>
        </property>
    </bean>

    <!-- Systeem heeft geen target nodig want hierin gebeuren geen Transacties -->
    <bean id="systeemImpl" class="be.ngb.bo.SysteemImpl">
        <property name="sessionFactory">
            <ref bean="sessionFactory"/>
        </property>
        <property name="landDAO">
            <ref bean="hibernateLandDAO"/>
        </property>
        <property name="periodeDAO">
            <ref bean="hibernatePeriodeDAO"/>
        </property>
        <property name="klasseDAO">
            <ref bean="hibernateKlasseDAO"/>
        </property>
    </bean>

    <bean id="wedstrijdImplTarget" class="be.ngb.bo.WedstrijdImpl">
        <property name="sessionFactory">
            <ref bean="sessionFactory"/>
        </property>
        <property name="uitslagDAO">
            <ref bean="hibernateUitslagDAO"/>
        </property>
        <property name="wedstrijdDAO">
            <ref bean="hibernateWedstrijdDAO"/>
        </property>
    </bean>

    <bean id="wedstrijdImpl" class="org.springframework.aop.framework.ProxyFactoryBean">
        <property name="proxyInterfaces">
            <value>be.ngb.bo.Wedstrijd</value>
        </property>
        <property name="interceptorNames">
            <list>
                <value>myTransactionInterceptor</value>
                <value>wedstrijdImplTarget</value>
            </list>
        </property>
    </bean>

</beans>


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 02, 2004 3:42 am 
Regular
Regular

Joined: Wed Apr 21, 2004 10:57 am
Posts: 62
Location: Hasselt, Belgium
Is it wrong if I do the following in every BO Impl file? Is this the reason why I have a new SessionFactory for every BO Impl?
BO layer

GebruikerImpl (Gebruiker = User)
Code:
public static Gebruiker getInstance() {
        if (instance == null) {
            instance = (Gebruiker) ApplicationContextFactory.getApplicationContext().getBean("gebruikerImpl");
        }
        return instance;
}


PloegImpl (Ploeg = Team)
Code:
public static Ploeg getInstance() {
        if (instance == null) {
            instance = (Ploeg) ApplicationContextFactory.getApplicationContext().getBean("ploegImpl");
        }
        return instance;
    }


...

As soon as I use 2 of these Impl files in the same request/response cycle or testmethod, the problems begin. Double sessions getting opened within the method call and returning an error in the end when I try another method.

If there is a problem in the way I use the applicationContext, please tell me. I'm a bit stuck at the moment.

thanks in advance

Peter


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 02, 2004 8:02 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Depends what ApplicationContextFactory.getApplicationContext() is doing...

Generally, no, this should not be a problem.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 03, 2004 2:52 am 
Regular
Regular

Joined: Wed Apr 21, 2004 10:57 am
Posts: 62
Location: Hasselt, Belgium
Hey Steve,

thanks for pointing me where to look for trouble.

I used the applicationContextFactory from the warfrog hibernate/spring/middlegen/xdoclet tutorial. Didn't expect any problems there, but when looking into the actual code again (with your comment in mind) it's all so obvious.

Instead of returning a single instance it just did
Code:
return new ClassPathXmlApplicationContext(contextResourceLocation);


Application works perfect now. Thanks again.

Peter


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 03, 2004 6:18 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Cool, glad to see you got it working. Spring and Hibernate is a pretty potent combination, have fun :)


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