Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9016205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:56:08+00:00 2026-06-16T03:56:08+00:00

I have one common project that is dependent to an application called application1. I

  • 0

I have one common project that is dependent to an application called application1. I configured in this way the xmls that each project has a distinct jdbc properties file ( different filename ), which directs to different database. Postgres and MySQL. I created the following snippet:

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"/applicationContext.xml", "/common-applicationContext.xml"})
@Transactional
public class AppTest extends AbstractTransactionalJUnit4SpringContextTests{
    static Logger log = Logger.getLogger(App.class.getName());
    @Resource(name = "testDao")
    private IDAO dao;//Traces testDao, which originates in common package
    @Resource(name = "testApplication1Dao")
    private IDAO daoApplication1;//Traces dao from application1 package
    @Test
    public void AppContextTest(){
        SessionFactory sf1 = dao.getHibernateTemplate().getSessionFactory();
        SessionFactory sf2 = daoApplication1.getHibernateTemplate().getSessionFactory();
  1. The classes TestDao and TestApplication1Dao, are extending IDAO.
    Common interface.
  2. testApplication1Dao->Postgres, configured in
    applicationContext.xml and in pgsql.jdbc.properties
  3. testDao->Mysql, configured in common-applicationContext.xml and in
    mysql.jdbc.properties.

Why debugging with eclipse, I see that dao and daoApplicatio1 are same objects? Should they?
How can I print on screen, the connections and properties behind each of the dao objects?

Thanks in advance

EDIT(1)

From common project:

import org.springframework.stereotype.Repository;
@Repository("testDao")
public class TestDao extends AbstractDao {}

From application1 project:

import org.springframework.stereotype.Repository;
import gr.org.infrastructure.common.db.AbstractDao;
@Repository("testApplication1Dao")
public class TestApplication1Dao extends AbstractDao {}

and the AbstractDao is an extension of IDAO ( interface ), nothing bizzare…:

@Transactional(propagation=Propagation.REQUIRED)
public abstract class AbstractDao implements IDAO {
    private HibernateTemplate hibernateTemplate;
    private boolean rollbacked;

    public AbstractDao() {
        super();
        this.rollbacked = false;
        // TODO Auto-generated constructor stub
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:56:10+00:00Added an answer on June 16, 2026 at 3:56 am

    Apparently solved the problem and I can have concurrently two seperate connections live in the spring/hibernate app. In case anyone is interested drop me a note.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a system that has three applications (one windows application and two web
Suppose one guy in my company has an sbt project called commons that's pretty
I have a site that has multiple Project objects. Each project has (for example):
I have some tables. These tables all have one column in common called 'classified_id':
I have several divs that share a common class. If one of these divs
I have to build an application using Maven for PHP that has multiple modules.
I have for two similar models with one common Manager, that returns queryset for
I have a clone of another python project (that has a setup.py etc.) in
My project modules are organized in such a way that I have to maintain
I have two maven-based eclipse projects, one being a project with common classes and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.