Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 38207 invoked from network); 19 Mar 2010 12:43:55 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 19 Mar 2010 12:43:55 -0000 Received: (qmail 51305 invoked by uid 500); 19 Mar 2010 12:43:55 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 51281 invoked by uid 500); 19 Mar 2010 12:43:55 -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 51274 invoked by uid 99); 19 Mar 2010 12:43:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Mar 2010 12:43:54 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [195.71.86.239] (HELO enyo.dsw2k3.info) (195.71.86.239) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Mar 2010 12:43:47 +0000 Received: from localhost (localhost [127.0.0.1]) by enyo.dsw2k3.info (Postfix) with ESMTP id 41CE0A683B5 for ; Fri, 19 Mar 2010 13:43:29 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at enyo.dsw2k3.info Received: from enyo.dsw2k3.info ([127.0.0.1]) by localhost (enyo.dsw2k3.info [127.0.0.1]) (amavisd-new, port 10024) with LMTP id q6aRfDlvmTCf for ; Fri, 19 Mar 2010 13:43:20 +0100 (CET) Received: from enyo.dsw2k3.info (localhost [127.0.0.1]) by enyo.dsw2k3.info (Postfix) with ESMTP id 5E2A098C63A for ; Fri, 19 Mar 2010 13:43:20 +0100 (CET) Received: from 87.193.164.178 (SquirrelMail authenticated user alr@emplify.de) by enyo.dsw2k3.info with HTTP; Fri, 19 Mar 2010 13:43:20 +0100 (CET) Message-ID: <21915.87.193.164.178.1269002600.squirrel@enyo.dsw2k3.info> Date: Fri, 19 Mar 2010 13:43:20 +0100 (CET) Subject: Novice problem with circular dependencies From: "Alexander Reelsen" To: user-java@ibatis.apache.org User-Agent: SquirrelMail/1.4.9a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Checked: Checked by ClamAV on apache.org Hi I am currently playing around with ibatis and stuck with bidirectional associations/circular dependencies - after googling a little bit around my understanding is, that it should work, when caching/lazy loading is enabled. So, consider the following java classes for small example: class Campaign { Integer id; String name; List targets; } class Target { Integer id; String name; String email; Campaign campaign; } This is basically the bidirectional association. Spoken from the application point of view something like user.getCampaign().getUsers().get(0).getCampaign() should work. >From the ibatis point of view I seem not to have understand yet correctly how to handle that. Here are my resultMaps However I keep getting a stackoverflow error, indicating that it does not work, when I call something like the java code above. Here goes the exception: java.lang.StackOverflowError at com.mysql.jdbc.ConnectionImpl.getCharsetConverter(ConnectionImpl.java:2904) at com.mysql.jdbc.ResultSetRow.getString(ResultSetRow.java:793) at com.mysql.jdbc.ByteArrayRow.getString(ByteArrayRow.java:72) at com.mysql.jdbc.ResultSetImpl.getStringInternal(ResultSetImpl.java:5700) at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5577) at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5617) at org.apache.ibatis.type.StringTypeHandler.getNullableResult(StringTypeHandler.java:17) at org.apache.ibatis.type.BaseTypeHandler.getResult(BaseTypeHandler.java:24) at org.apache.ibatis.executor.resultset.FastResultSetHandler.getPropertyMappingValue(FastResultSetHandler.java:225) at org.apache.ibatis.executor.resultset.FastResultSetHandler.applyPropertyMappings(FastResultSetHandler.java:208) at org.apache.ibatis.executor.resultset.NestedResultSetHandler.getRowValue(NestedResultSetHandler.java:106) at org.apache.ibatis.executor.resultset.NestedResultSetHandler.applyNestedResultMappings(NestedResultSetHandler.java:136) at org.apache.ibatis.executor.resultset.NestedResultSetHandler.getRowValue(NestedResultSetHandler.java:107) at org.apache.ibatis.executor.resultset.NestedResultSetHandler.applyNestedResultMappings(NestedResultSetHandler.java:136) at org.apache.ibatis.executor.resultset.NestedResultSetHandler.getRowValue(NestedResultSetHandler.java:107) [from here the last two lines keep alternating] I put a quick look at ibatis jira issues 760[1] and 427[2], but that didn't help me so far. Regards and many thanks for any insightful pointers, Alexander [1] https://issues.apache.org/jira/browse/IBATIS-760 [2] https://issues.apache.org/jira/browse/IBATIS-427 -- http://www.emplify.de --------------------------------------------------------------------- To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org For additional commands, e-mail: user-java-help@ibatis.apache.org