Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 34227 invoked from network); 5 Aug 2006 09:58:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Aug 2006 09:58:31 -0000 Received: (qmail 64985 invoked by uid 500); 5 Aug 2006 09:58:29 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 64960 invoked by uid 500); 5 Aug 2006 09:58:29 -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 64720 invoked by uid 99); 5 Aug 2006 09:58:29 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Aug 2006 02:58:28 -0700 X-ASF-Spam-Status: No, hits=2.9 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,HTML_10_20,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [217.12.10.177] (HELO web25705.mail.ukl.yahoo.com) (217.12.10.177) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 05 Aug 2006 02:58:27 -0700 Received: (qmail 79812 invoked by uid 60001); 5 Aug 2006 09:58:06 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.uk; h=Message-ID:Received:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=3+JLezNWrVgHtPFt5doh4F0eyhoFTEkpa5w4QV3XHcDgSxX+3m916zLI+eZT5KhGC+1sLyLXVan3RhxQQwvX2F9Piy6M1DL2dcxc6RIeM4LJSMVA/OjMZwZciesFvudQz3WNV6DlVHtfzXxaaU2ULs9CVR4lOJi1pcQxcWGi/fQ= ; Message-ID: <20060805095806.79810.qmail@web25705.mail.ukl.yahoo.com> Received: from [219.95.201.43] by web25705.mail.ukl.yahoo.com via HTTP; Sat, 05 Aug 2006 09:58:06 GMT Date: Sat, 5 Aug 2006 09:58:06 +0000 (GMT) From: tm jee Reply-To: tm jee Subject: iBatis session To: user-java@ibatis.apache.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-980359124-1154771886=:78784" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --0-980359124-1154771886=:78784 Content-Type: text/plain; charset=us-ascii Hi guys, With the following code, sqlMapClient.queryForList(....); // 1 sqlMapClient.queryForList(....); // 2 Will (1) and (2) be executed in the same session or in a seprate session. In the Javadoc of SqlMapClient's openSession() it says that "Remember though, that SqlMapClient itself is a thread safe SqlMapSession implementation, so you can also just work directly with it" Is it that sqlMapClient is a session itself (thread-safe) such that when executing "queryForList", its done in the same session? With the following, SqlMapSession session1 = sqlMapClient.openSession(); session1.queryForList(...); // 1a session1.queryForList(...); // 1b .... session1.close(); SqlMapSession session1 = sqlMapClient.openSession(); session2.queryForList(...); //2a session2.queryForList(...); //2b .... session2.close(); Is it correct to say that if a cacheModel is defined for all the queryForList statement, 1a and 1b will uses the same cache as they are from the same session while 2a and 2b will be using the same cache as they are from the same session? If sqlMapClient is a session itself, is it correct to say that all the statement executed within sqlMapClient itself will be using the same cache if one is defined? Tia. regards --0-980359124-1154771886=:78784 Content-Type: text/html; charset=us-ascii
Hi guys,

With the following code,

sqlMapClient.queryForList(....);  // 1
sqlMapClient.queryForList(....);  // 2

Will (1) and (2) be executed in the same session or in a seprate session. In the Javadoc of SqlMapClient's openSession() it says that
"Remember though, that SqlMapClient itself is a thread safe SqlMapSession implementation, so you can also just work directly with it"

Is it that sqlMapClient is a session itself (thread-safe) such that when executing "queryForList", its done in the same session?

With the following,
SqlMapSession session1 = sqlMapClient.openSession();
session1.queryForList(...); // 1a
session1.queryForList(...); // 1b
....
session1.close();

SqlMapSession session1 = sqlMapClient.openSession();
session2.queryForList(...); //2a
session2.queryForList(...); //2b
....
session2.close();

Is it correct to say that if a cacheModel is defined for all the queryForList statement, 1a and 1b will uses the same cache as they are from the same session while 2a and 2b will be using the same cache as they are from the same session?

If sqlMapClient is a session itself, is it correct to say that all the statement executed within sqlMapClient itself will be using the same cache if one is defined?

Tia.

regards


--0-980359124-1154771886=:78784--