Return-Path: Mailing-List: contact ibatis-user-java-help@incubator.apache.org; run by ezmlm Delivered-To: mailing list ibatis-user-java@incubator.apache.org Received: (qmail 28599 invoked by uid 99); 28 Jan 2005 15:25:54 -0000 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS,URIBL_WS_SURBL X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of brandon.goodin@gmail.com designates 64.233.170.192 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (64.233.170.192) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 28 Jan 2005 07:25:52 -0800 Received: by rproxy.gmail.com with SMTP id r35so512492rna for ; Fri, 28 Jan 2005 07:25:50 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=bdS+5z8WFppOap3/jCs2ZEnjDl4sQiOluuKgPQpXfnDsG8SoeLime5T6ngNXVDtHsmX8G2egb/W2JXHzPne48IGcBrHr5t+/ucSwyoSecBgQI5oMb0T5kTQe2YJQawSxX2wJrrrSehiXaWGXQiw2icDcGgY0ei5G3GAxdfvJVm8= Received: by 10.38.13.58 with SMTP id 58mr35567rnm; Fri, 28 Jan 2005 07:25:50 -0800 (PST) Received: by 10.38.74.56 with HTTP; Fri, 28 Jan 2005 07:25:50 -0800 (PST) Message-ID: <2fe5ef5b0501280725ceee7f1@mail.gmail.com> Date: Fri, 28 Jan 2005 08:25:50 -0700 From: Brandon Goodin Reply-To: Brandon Goodin To: ibatis-user-java@incubator.apache.org, tony@digitalcentral.net Subject: Re: One DAO implementatino for multiple databases In-Reply-To: <-1235802383601599123@unknownmsgid> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable References: <-1235802383601599123@unknownmsgid> X-Virus-Checked: Checked 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 wrote= : > =20 > =20 >=20 > Hi all =E2=80=93=20 >=20 > =20 >=20 > 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 differ= ent > databases. I'm pulling in data from an MS Access database (yes, please f= eel > 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 implementat= ion > 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?=20 >=20 > =20 >=20 > Any suggestions?=20 >=20 > =20 >=20 > Thanks,=20 >=20 > Tony=20 >=20 >