Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 50772 invoked from network); 10 Jan 2009 21:07:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Jan 2009 21:07:12 -0000 Received: (qmail 17684 invoked by uid 500); 10 Jan 2009 21:07:06 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 17665 invoked by uid 500); 10 Jan 2009 21:07:06 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 17654 invoked by uid 99); 10 Jan 2009 21:07:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Jan 2009 13:07:06 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jeffgbutler@gmail.com designates 64.233.170.188 as permitted sender) Received: from [64.233.170.188] (HELO rn-out-0910.google.com) (64.233.170.188) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Jan 2009 21:06:59 +0000 Received: by rn-out-0910.google.com with SMTP id j66so6523424rne.9 for ; Sat, 10 Jan 2009 13:06:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=agClxBLAgk2HVCw2bdHjH1gUXgVkvPS1ZVytIVfEq6o=; b=QQFaMvfpBf1MijLbpNNkud/dhBlv6EZSSFyp8J7+DQQabZY25dROd74qjYVGUYlg0d WLiVjmG6x/ywPYMj7xjcjO0l1+K2CwwRm06sffcMSFfi4JgMeJYjNyGbhb5WiZM7wVQg O2iL8vNbNuqAXGLhxYDCrbKm/JqioWFciN6B4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=LwKhh/ivgJspfor1AR0RK8Y+u1nv3BUPNRb7w8hv7yZvcpYmLklKzAl7pDgxF+NxX1 zHVNOVCri8c9Mp6tnxpihzGeXan2O5Od8uuiyy1BLbi1E1XHMalBX3GdKPWBqDhBPGWa k0UJnvCqJEFoZRWpao9nCYME4TP2GzsZJFoug= Received: by 10.150.97.19 with SMTP id u19mr6886246ybb.114.1231621598600; Sat, 10 Jan 2009 13:06:38 -0800 (PST) Received: by 10.151.44.7 with HTTP; Sat, 10 Jan 2009 13:06:38 -0800 (PST) Message-ID: Date: Sat, 10 Jan 2009 15:06:38 -0600 From: "Jeff Butler" To: user-java@ibatis.apache.org Subject: Re: Way to declare transactionManager section in a separate file and have it picked up? In-Reply-To: <583d4dff0901101043v5d8de5d7x801e5aec0b1678d5@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <583d4dff0901101043v5d8de5d7x801e5aec0b1678d5@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org You probably can't do it without a little coding. But you already know Spring can do this, so it must be possible - right? The basic idea is that you leave the transaction configuration out of the SqlMapConfig file, then apply the transaction manager programmaticaly. Take a look at the source for org.springframework.orm.ibatis.SqlMapClientFactoryBean, you'll see how they do it in the applyTransactionConfig method. Jeff Butler On Sat, Jan 10, 2009 at 12:43 PM, Rick wrote: > sorry if this is in the documentation somewhere, but I haven't found > it. (man, I'd love to be able to search in the PDF:). Anyway, I know I > can use a properties file for declaring properties that can be > substituted in in the transaction manager properties, but this > persistence jar i'm creating, I'd like to allow the end user to decide > how they want to set up the transaction manager. For example someone > might want to use jndi which is only one property vs all the > properties they might define if using simple datasource. I want the > rest of the sql config though to not be exposed to the end user > (that's bundled in my jar), I just want the end user to have to > provide a transactionmanager section. How would I go about setting > this up? I'm currently loading the slqmap config like: > > Reader reader = Resources.getResourceAsReader(sqlMapConfigLocation); > sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader); > > But that only seems to take the location of a single file. Is there a > way I can declare the transactionManager section in a separate file > that will still be still in the classpath and have that picked > up(merged?) with the sqlmap config file or used by the > SqlMapClientBuilder? > > Thanks > > -- > Rick >