Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 211469D83 for ; Wed, 11 Jan 2012 22:59:06 +0000 (UTC) Received: (qmail 47771 invoked by uid 500); 11 Jan 2012 22:59:05 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 47555 invoked by uid 500); 11 Jan 2012 22:59:04 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 47538 invoked by uid 99); 11 Jan 2012 22:59:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jan 2012 22:59:04 +0000 X-ASF-Spam-Status: No, hits=3.2 required=5.0 tests=FREEMAIL_FORGED_REPLYTO,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [217.146.183.250] (HELO nm14-vm0.bullet.mail.ukl.yahoo.com) (217.146.183.250) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 11 Jan 2012 22:58:55 +0000 Received: from [217.146.183.208] by nm14.bullet.mail.ukl.yahoo.com with NNFMP; 11 Jan 2012 22:58:35 -0000 Received: from [217.146.183.34] by tm1.bullet.mail.ukl.yahoo.com with NNFMP; 11 Jan 2012 22:58:35 -0000 Received: from [127.0.0.1] by omp1023.mail.ukl.yahoo.com with NNFMP; 11 Jan 2012 22:58:35 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 9835.73286.bm@omp1023.mail.ukl.yahoo.com Received: (qmail 59335 invoked by uid 60001); 11 Jan 2012 22:58:34 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1326322714; bh=viDAZaUsyXXn692Mw+ZxU8KmirAokRpize6hcrsqEyI=; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=HZjRSbFF3FE6Hwsp9CPs7kPzspUp+V36hrWVkXzRNAaT3tU3BDjg9BpyhqIIJgZtoFR0yqB23PS1zxrg6EWwo/HKSU8jsZDGwj1OWjwMZi78wpLZi0UwlF3mxgcylpuU5msl5iL9nEg2TlTdy5gYfaK5ahgUHBPWt4LattWSOkc= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.de; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=x4l3W+wDruRaBDJadB5NusY5kZ0nQsY6rEKZMqb/L3KFgl2UWMa3JiZ7oIHas+enN2IHdG8nUPlJ/aBX95BOjQyJ3sf4WMwUpKoiKbx1RPIxpxBB2pynCd4cpjWm2Q8xo/QHrcD/dM1415mxOayxKhgE9LkjoIgFtt7UlM1Knv0=; X-YMail-OSG: bOQplQQVM1lBKdfo2FpwIkwU4Dtzb0jsHVHpE6qEDS8zgr4 aB78SF7XuHzHIIkttzO86nXE1ec6zkr0i.GKEx8MIpQZtbSoeEXy9greXV1k iuqaEuGZvpQNryZ2_D2GdwJaeFp5rr4Ip15v77Wgmej53zBhVQtPz86plCD0 V8i7ILhMlqBWoIg2cWfPmrr4NzQqhPU5n517OF.BVr1UAZQD9A3qMxPlsir4 iuSY5tiauQDOPnUCSiWNl2nhe9Zim4gkpVxUw1hwgYWRh3ZSJBBRz2QLIR.L fLkFi0Z_Q6buxjs2t.nsCv7GwwihrPYPv07yi0FpiizJRpLsIVcixJZUZQ1q OFR3jqQtGYAwtw48LPi_A_mQ3JZbqi9BgK6DixAKJ22Yu1IHH62FhBwPfEqM R4BzlZ7uuAQ9RCA-- Received: from [80.108.122.184] by web27806.mail.ukl.yahoo.com via HTTP; Wed, 11 Jan 2012 22:58:34 GMT X-Mailer: YahooMailWebService/0.8.115.331698 Message-ID: <1326322714.50325.YahooMailNeo@web27806.mail.ukl.yahoo.com> Date: Wed, 11 Jan 2012 22:58:34 +0000 (GMT) From: Mark Struberg Reply-To: Mark Struberg Subject: ManagedCache cache issues? To: openjpa-dev MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Checked: Checked by ClamAV on apache.org hi! I'm debugging through a weird bug I have here locally. While doing that I figured that the the cache could suffer from clashes ManagedCache.java StateManagerImpl orig = _main.put(sm.getObjectId(), sm); the problem is that the same instance of the ManagedCache is being used for different Entities. But for different entities, the ids could be overlapping! I'm e.g. using Which means that there could be a Customer with id=10001 and an Address with id=10001. Some query which would touch both would create a clash in the ManagedCache. It might (and reasonably ok performance wise) be safe to add something like int entityHash = sm.getPersistenceCapable().getClass().hashCode(); StateManagerImpl orig = _main.put(entityHash + (29 * sm.getObjectId()), sm); wdyt? LieGrue, strub