From issues-return-81191-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Thu Nov 8 23:17:03 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id B6BA2180671 for ; Thu, 8 Nov 2018 23:17:02 +0100 (CET) Received: (qmail 85525 invoked by uid 500); 8 Nov 2018 22:17:01 -0000 Mailing-List: contact issues-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list issues@ignite.apache.org Received: (qmail 85516 invoked by uid 99); 8 Nov 2018 22:17:01 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2018 22:17:01 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 54737C233F for ; Thu, 8 Nov 2018 22:17:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id SWwWc1lPm64D for ; Thu, 8 Nov 2018 22:16:58 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 23E29779FF for ; Thu, 8 Nov 2018 15:56:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 5A1FDE006D for ; Thu, 8 Nov 2018 15:56:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 144AE266AF for ; Thu, 8 Nov 2018 15:56:00 +0000 (UTC) Date: Thu, 8 Nov 2018 15:56:00 +0000 (UTC) From: "Alexey Platonov (JIRA)" To: issues@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (IGNITE-10195) Cannot create caches with different names but with same indexed types and schema name MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/IGNITE-10195?page=3Dcom.atlass= ian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alexey Platonov updated IGNITE-10195: ------------------------------------- Description:=20 Cannot create caches with different names but with same indexed types and s= chema name. For example, such code will throw exception "javax.cache.CacheE= xception: Table already exists: PERSON". =C2=A0 {code:java} node.createCache(new CacheConfiguration() .setName("PERSON_1") .setIndexedTypes(Key.class, Person.class) .setSqlSchema(QueryUtils.DFLT_SCHEMA)); node.createCache(new CacheConfiguration() .setName("PERSON_2") .setIndexedTypes(Key.class, Person.class) .setSqlSchema(QueryUtils.DFLT_SCHEMA)); {code} =C2=A0 If I set table name manually by setQueryEntities(...) then "javax.cache.Cac= heException: Index already exists: PERSON_ORGID_IDX" wil be thrown (Value h= as field with "origId" and annotation {color:#bbb529}@QuerySqlField{color}(= {color:#d0d0ff}index {color}=3D {color:#cc7832}true{color})). Here is defin= ition of Person class: =C2=A0\{code}=20 {color:#cc7832}public static class {color}PersonKey { {color:#bbb529}@QuerySqlField{color} {color:#cc7832}public long {color}{co= lor:#9876aa}id{color}{color:#cc7832};{color} {color:#629755}/**{color}{colo= r:#629755} * Constructor.{color}{color:#629755} *{color}{color:#629755} * {= color}{color:#629755}@param {color}{color:#8a653b}id {color}{color:#629755}= ID.{color}{color:#629755} */{color} {color:#ffc66d}PersonKey{color}({color:= #cc7832}long {color}id) { {color:#cc7832}this{color}.{color:#9876aa}id {color}=3D id{color:#cc7832};= {color} } {color:#629755}/** {{color}{color:#629755}@inheritDoc{color}{color:#629755}= } */ @Override {color:#cc7832}public int {color}{color:#ffc66d}hashCode{color}(= ) { {color:#cc7832}return {color}({color:#cc7832}int{color}){color:#9876aa}id{= color}{color:#cc7832};{color} } {color:#629755}/** {{color}{color:#629755}@inheritDoc{color}{color:#629755}= } */ @Override {color:#cc7832}public boolean {color}{color:#ffc66d}equals{color= }(Object obj) { {color:#cc7832}return {color}obj !=3D {color:#cc7832}null {color}&& obj {c= olor:#cc7832}instanceof {color}PersonKey && (F.eq({color:#9876aa}id{color}{= color:#cc7832}, {color}((PersonKey)obj).{color:#9876aa}id{color})){color:#c= c7832};{color} } } =C2=A0\{code} Such behavior seems to be usability bug. Why I cannot create two caches wit= h different names but with same indexed values? was: Cannot create caches with different names but with same indexed types and s= chema name. For example, such code will throw exception "javax.cache.CacheE= xception: Table already exists: PERSON". =C2=A0 {code} node.createCache(new CacheConfiguration() .setName("PERSON_1") .setIndexedTypes(Key.class, Person.class) .setSqlSchema(QueryUtils.DFLT_SCHEMA)); node.createCache(new CacheConfiguration() .setName("PERSON_2") .setIndexedTypes(Key.class, Person.class) .setSqlSchema(QueryUtils.DFLT_SCHEMA)); {code} =C2=A0 If I set table name manually by setQueryEntities(...) then "javax.cache.Cac= heException: Index already exists: PERSON_ORGID_IDX" wil be thrown (Value h= as field with "origId" and annotation {color:#bbb529}@QuerySqlField{color}(= {color:#d0d0ff}index {color}=3D {color:#cc7832}true{color})). Here is defin= ition of Person class: =C2=A0 {color:#cc7832}public static class {color}PersonKey { {color:#bbb529}@QuerySqlField{color} {color:#cc7832}public long {color}{co= lor:#9876aa}id{color}{color:#cc7832};{color} {color:#629755}/**{color}{colo= r:#629755} * Constructor.{color}{color:#629755} *{color}{color:#629755} * {= color}{color:#629755}@param {color}{color:#8a653b}id {color}{color:#629755}= ID.{color}{color:#629755} */{color} {color:#ffc66d}PersonKey{color}({color:= #cc7832}long {color}id) { {color:#cc7832}this{color}.{color:#9876aa}id {color}=3D id{color:#cc7832};= {color} } {color:#629755}/** {{color}{color:#629755}@inheritDoc{color}{color:#629755}= } */ @Override {color:#cc7832}public int {color}{color:#ffc66d}hashCode{color}(= ) { {color:#cc7832}return {color}({color:#cc7832}int{color}){color:#9876aa}id{= color}{color:#cc7832};{color} } {color:#629755}/** {{color}{color:#629755}@inheritDoc{color}{color:#629755}= } */ @Override {color:#cc7832}public boolean {color}{color:#ffc66d}equals{color= }(Object obj) { {color:#cc7832}return {color}obj !=3D {color:#cc7832}null {color}&& obj {c= olor:#cc7832}instanceof {color}PersonKey && (F.eq({color:#9876aa}id{color}{= color:#cc7832}, {color}((PersonKey)obj).{color:#9876aa}id{color})){color:#c= c7832};{color} } } =C2=A0 Such behavior seems to be usability bug. Why I cannot create two caches wit= h different names but with same indexed values? > Cannot create caches with different names but with same indexed types and= schema name > -------------------------------------------------------------------------= ------------ > > Key: IGNITE-10195 > URL: https://issues.apache.org/jira/browse/IGNITE-10195 > Project: Ignite > Issue Type: Improvement > Reporter: Alexey Platonov > Priority: Major > > Cannot create caches with different names but with same indexed types and= schema name. For example, such code will throw exception "javax.cache.Cach= eException: Table already exists: PERSON". > =C2=A0 > {code:java} > node.createCache(new CacheConfiguration() > .setName("PERSON_1") > .setIndexedTypes(Key.class, Person.class) > .setSqlSchema(QueryUtils.DFLT_SCHEMA)); > node.createCache(new CacheConfiguration() > .setName("PERSON_2") > .setIndexedTypes(Key.class, Person.class) > .setSqlSchema(QueryUtils.DFLT_SCHEMA)); > {code} > =C2=A0 > If I set table name manually by setQueryEntities(...) then "javax.cache.C= acheException: Index already exists: PERSON_ORGID_IDX" wil be thrown (Value= has field with "origId" and annotation {color:#bbb529}@QuerySqlField{color= }({color:#d0d0ff}index {color}=3D {color:#cc7832}true{color})). Here is def= inition of Person class: > =C2=A0\{code}=20 > {color:#cc7832}public static class {color}PersonKey { > {color:#bbb529}@QuerySqlField{color} {color:#cc7832}public long {color}{= color:#9876aa}id{color}{color:#cc7832};{color} {color:#629755}/**{color}{co= lor:#629755} * Constructor.{color}{color:#629755} *{color}{color:#629755} *= {color}{color:#629755}@param {color}{color:#8a653b}id {color}{color:#62975= 5}ID.{color}{color:#629755} */{color} {color:#ffc66d}PersonKey{color}({colo= r:#cc7832}long {color}id) { > {color:#cc7832}this{color}.{color:#9876aa}id {color}=3D id{color:#cc7832= };{color} } > {color:#629755}/** {{color}{color:#629755}@inheritDoc{color}{color:#62975= 5}} */ > @Override {color:#cc7832}public int {color}{color:#ffc66d}hashCode{color= }() { > {color:#cc7832}return {color}({color:#cc7832}int{color}){color:#9876aa}i= d{color}{color:#cc7832};{color} } > {color:#629755}/** {{color}{color:#629755}@inheritDoc{color}{color:#62975= 5}} */ > @Override {color:#cc7832}public boolean {color}{color:#ffc66d}equals{col= or}(Object obj) { > {color:#cc7832}return {color}obj !=3D {color:#cc7832}null {color}&& obj = {color:#cc7832}instanceof {color}PersonKey && (F.eq({color:#9876aa}id{color= }{color:#cc7832}, {color}((PersonKey)obj).{color:#9876aa}id{color})){color:= #cc7832};{color} } > } > =C2=A0\{code} > Such behavior seems to be usability bug. Why I cannot create two caches w= ith different names but with same indexed values? -- This message was sent by Atlassian JIRA (v7.6.3#76005)