ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brandon Goodin <brandon.goo...@gmail.com>
Subject Re: One DAO implementatino for multiple databases
Date Fri, 28 Jan 2005 15:25:50 GMT
You can only declare a single Dao implementation per DaoManager. This
is due to the fact that the Dao interface name is used as the key to
lookup the implementation. I think the easiest route for you may be to
extend the interface of your Daos interfaces that are shared. That way
you will have a unique interface for each yet they can have the same
implementation class.

Brandon

On Thu, 27 Jan 2005 15:04:52 -0800, Tony Li <tony@digitalcentral.net> wrote:
>  
>  
> 
> Hi all – 
> 
>   
> 
> I'm new to iBatis, and I want to find out the best practice for this
> problem.  I want to use the same DAO implementation on a number of different
> databases.  I'm pulling in data from an MS Access database (yes, please feel
> sorry for me here) that's been deployed in several locations.  I'm using the
> both the iBATIS DAO layer and SqlMaps.  Since I declare a DAO implementation
> under a specific Transaction Manager, and only one DataSource can be
> specified per transaction, I'm not sure what to do.  If I define the same
> DAO implementation under a different Transaction Manager and Context, how
> would iBatis know which one to use when I ask for the DAO from the
> DaoManager? 
> 
>   
> 
> Any suggestions? 
> 
>   
> 
> Thanks, 
> 
> Tony 
> 
>

Mime
View raw message