Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 11225 invoked from network); 8 Sep 2006 15:32:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Sep 2006 15:32:41 -0000 Received: (qmail 4619 invoked by uid 500); 8 Sep 2006 15:32:38 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 4601 invoked by uid 500); 8 Sep 2006 15:32:38 -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 4576 invoked by uid 99); 8 Sep 2006 15:32:38 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Sep 2006 08:32:38 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of nathan.maves@gmail.com designates 64.233.166.181 as permitted sender) Received: from [64.233.166.181] (HELO py-out-1112.google.com) (64.233.166.181) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Sep 2006 08:32:36 -0700 Received: by py-out-1112.google.com with SMTP id b29so751056pya for ; Fri, 08 Sep 2006 08:31:43 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=VIYfa59Z0qcEUczj1rSmqb+0xxLEW2TogkQGKyqNu7i2u6TiZOO13Oj6XtTl8K+OPIhElzJT6G+2t/S6tUGlt7jUngfp3ZK5QWFYOT5rqTflYmydc/3nd7/mzBq9DYku/2Z7rw/Iu1w7YOowr853abnT0kG8RGQHgqQgOzboVIs= Received: by 10.35.80.20 with SMTP id h20mr3135317pyl; Fri, 08 Sep 2006 08:31:42 -0700 (PDT) Received: by 10.35.26.2 with HTTP; Fri, 8 Sep 2006 08:31:42 -0700 (PDT) Message-ID: <2f55db670609080831n7ed0b456j31af9703e2310072@mail.gmail.com> Date: Fri, 8 Sep 2006 09:31:42 -0600 From: "Nathan Maves" To: user-java@ibatis.apache.org Subject: Re: [RESOLVED] Re: Problem with multi-select inside a resultMap since Ibatis 2.20 (colored...) In-Reply-To: <45011D44.4050802@free.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <44FC5EED.300@free.fr> <44FCA2BD.9050004@free.fr> <44FD4167.8080603@free.fr> <44FE805D.40805@free.fr> <44FFC7DC.4080207@free.fr> <2f55db670609070847i519f2839re0ea6f5461ee6aac@mail.gmail.com> <45011D44.4050802@free.fr> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Well yes and no. The idea of using spring for injection fails when you find your self manually doing it yourself. I can only assume that in your dao you were passing the datasource to the sqlMap factory. This should be done with spring to stay consistent. Nathan On 9/8/06, TNO wrote: > It's the mystery of life... ;-) > No, I can't tell you why I injected the dataSource into my DAO. > But both seems to be correct... > > Nathan Maves a =E9crit : > > Now that you found the difference can you tell us why you were > > injecting a datasource into your dao? > > > > My applications are configured the same was Jeff's are. > > > > > > > > On 9/7/06, TNO wrote: > >> > >> This is problem Spring/Ibatis ! > >> By examinig your bean, the only difference was the injection of the > >> datasource. > >> I injected it in the DAO and you, in the SqlMapClientFactoryBean > >> > >> BUG : > >> > >> >> class=3D"org.springframework.orm.ibatis.SqlMapClientFactoryBean > >> "> > >> > >> > >> classpath:arc/db/config/sql-map-config-arcdb.xml > >> > >> > >> ... > >> >> arc.db.auto.dao.ibatis.PlanDAOiBatis" lazy-init=3D"true"> > >> > >> >> /> > >> > >> > >> > >> NO BUG : > >> > >> >> class=3D"org.springframework.orm.ibatis.SqlMapClientFactoryBean > >> "> > >> > >> > >> classpath:arc/db/config/sql-map-config-arcdb.xml > >> > >> > >> > >> ... > >> >> arc.db.auto.dao.ibatis.PlanDAOiBatis" lazy-init=3D"true"> > >> >> /> > >> > >> > >> > >> > >> In SqlMapClientFactoryBean javaDoc : > >> *

Allows to specify a DataSource at the SqlMapClient level. This = is > >> * preferable to per-DAO DataSource references, as it allows for lazy > >> loading > >> * and avoids repeated DataSource references. > >> > >> > >> > >> Thanks a lot Jeff, and longue vie =E0 Ibatis > >> > >> Thomas > >> > >> Jeff Butler a =E9crit : > >> > >> I've migrated my test case to Spring, and everything still works OK. > >> Here's > >> my beans.xml: > >> > >> > >> >> class=3D"com.ibatis.common.jdbc.SimpleDataSource"> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> >> > >> class=3D"org.springframework.orm.ibatis.SqlMapClientFactoryBean"> > >> > >> > >> classpath:test/sqlmap/TestSqlMapConfig.xml > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> My AnimalDAOImpl class extends Spring's SqlMapClientTemplate. I'll > >> send you > >> the entire test case offline if you're interested. It works with > >> HSQLDB and > >> is just a Java application (no web dependancies). > >> > >> Jeff Butler > >> > >> > >> > >> On 9/6/06, TNO wrote: > >> > > >> > > >> > I'm using Spring, Ibatis, and postgreSql 8.0 > >> > one project call XxxDAO which manage all the DAO (no transaction) > >> > one project call XxxMgr which manage every transactions > >> > > >> > So when I lauch my junit test on XxxDAO, there is no transaction > >> manager, > >> only a SimpleDataSource from Ibatis. > >> > Here's the db config > >> > > >> > > >> > >> class=3D"org.springframework.beans.factory.config.PropertyPlaceholderC= onfigurer"> > >> > >> > > >> > > >> > arc/constante/jdbc.properties > >> > > >> > > >> > > >> > >> class=3D"com.ibatis.common.jdbc.SimpleDataSource "> > >> > > >> > > >> > > >> > > >> > > >> > > >> > >> value=3D"${jdbc.defaultAutoCommit}"/> > >> > > >> > > >> > >> value=3D"1000000"/> > >> > > >> > > >> > > >> > > >> > > >> > > >> > Then, I have a big file sql-init-config.xml which contains all my > >> alias > >> for ibatis for each table > >> > example : > >> > > >> > > >> > > >> > > >> > > >> > > >> > >> column=3D"plan_t_avis_controlleur" /> > >> > >> column=3D"plan_t_avis_representant_salarie" /> > >> > > >> > >> column=3D"plan_t_remplacement_dirigeant" /> > >> > >> column=3D"plan_t_actif_situation" /> > >> > >> column=3D"plan_m_cumul_declaration" /> > >> > >> column=3D"plan_i_plan_option_def" /> > >> > >> column=3D"plan_i_plan_option_non" /> > >> > > >> > > >> > > >> > > >> > > >> > > >> > >> column=3D"plan_d_prochaine_echeance" /> > >> > >> column=3D"plan_b_validation_encours" /> > >> > > >> > > >> > > >> > > >> > > >> > plan.i_plan AS plan_i_plan, > >> > plan.i_mandat AS plan_i_mandat, > >> > plan.t_info_assedic AS plan_t_info_assedic, > >> > plan.t_avis_controlleur AS plan_t_avis_controlleur, > >> > plan.t_avis_representant_salarie AS > >> plan_t_avis_representant_salarie, > >> > plan.t_garantie AS plan_t_garantie, > >> > plan.t_remplacement_dirigeant AS plan_t_remplacement_dirigeant, > >> > plan.t_actif_situation AS plan_t_actif_situation, > >> > plan.m_cumul_declaration AS plan_m_cumul_declaration, > >> > plan.i_plan_option_def AS plan_i_plan_option_def, > >> > plan.i_plan_option_non AS plan_i_plan_option_non, > >> > plan.b_privi AS plan_b_privi, > >> > plan.b_chiro AS plan_b_chiro, > >> > plan.b_conteste AS plan_b_conteste, > >> > plan.b_provi AS plan_b_provi, > >> > plan.b_aechoir AS plan_b_aechoir, > >> > plan.b_valider AS plan_b_valider, > >> > plan.d_prochaine_echeance AS plan_d_prochaine_echeance, > >> > plan.b_validation_encours AS plan_b_validation_encours, > >> > plan.b_echeancier AS plan_b_echeancier, > >> > plan.b_reprise AS plan_b_reprise > >> > > >> > > >> > > >> > SELECT > >> > > >> > FROM plan > >> > > >> > > >> > Then, one XxxSql.xml for each table which contains my failed query > >> > > >> > > >> > > >> > > >> > > >> > > >> > >> > select=3D"getEcheanceOptionFromIdPlan" column=3D"plan_i_plan" > >> /> > >> > >> > select=3D"getEcheancePlanFromIdPlan" column=3D"plan_i_plan" > >> /> > >> > >> select=3D"getPlanOptionFromIdPlan" > >> > column=3D"plan_i_plan" /> > >> > > >> > > >> > > >> > > >> > > >> > All xml files are in the sqlMapConfig, but i don't have any > >> transaction > >> manager... > >> > > >> > > >> > ... > >> > >> resource=3D"arc/db/auto/dao/ibatis/config/PlanSQL.xml" /> > >> > ... > >> > > >> > > >> > > >> > Then, In my Spring application-context, I have > >> > > >> > > >> > >> class=3D"org.springframework.orm.ibatis.SqlMapClientFactoryBean > >> "> > >> > > >> > > >> classpath:arc/db/config/sql-map-config-arcdb.xml > >> > > >> > > >> > ... > >> > >> arc.db.auto.dao.ibatis.PlanDAOiBatis" lazy-init=3D"true"> > >> > >> /> > >> > >> /> > >> > > >> > > >> > ... > >> > > >> > My TestPlanDAOIbatis is a reproductible test case with my own data..= . > >> > I can give you everything if you want to reproduce it ! > >> > > >> > thanks, Tom > >> > > >> > > >> ________________________________ > >> > >> No virus found in this incoming message. > >> Checked by AVG Free Edition. > >> Version: 7.1.405 / Virus Database: 268.12.1/440 - Release Date: > >> 06/09/2006 > >> > >> > >> -- > >> Il n'y a pas de mauvais langage, il n'y a que des bons programmeurs > >> > > > > > > > > -- > Il n'y a pas de mauvais langage, il n'y a que des bons programmeurs > >