From user-return-26058-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Mon May 27 12:20:40 2019 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 [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 5F41F180638 for ; Mon, 27 May 2019 14:20:40 +0200 (CEST) Received: (qmail 58876 invoked by uid 500); 27 May 2019 12:20:38 -0000 Mailing-List: contact user-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ignite.apache.org Delivered-To: mailing list user@ignite.apache.org Received: (qmail 58866 invoked by uid 99); 27 May 2019 12:20:38 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 May 2019 12:20:38 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 4ACCA180C86 for ; Mon, 27 May 2019 12:20:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.801 X-Spam-Level: * X-Spam-Status: No, score=1.801 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id uBzfVBWNsaDy for ; Mon, 27 May 2019 12:20:33 +0000 (UTC) Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id CE15F5FDA5 for ; Mon, 27 May 2019 12:20:31 +0000 (UTC) Received: by mail-ed1-f49.google.com with SMTP id e24so26477824edq.6 for ; Mon, 27 May 2019 05:20:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=l6xQwfZDNH8MGLplWVDKDzFMqNG+bF5AG03cC166d5w=; b=oGxJzfdUZ0xYDA9r2jflrOed97tMf+UwJKaHfJBLUdV5Uni/p4II6BLxD9+CaOYPf6 EU4Cn7x9w4w0uG+8YD3gRPTbqvABtOqo3daIPmHQhv8mJgv3XfNPnTd0fX18Q2HG9IbY 2peT5gEYppixSAJMfJ7LHkyREFfBzakEHQiUH3Lzlqm9O1nfNgbSsVFzraiBr8VTLrAK IuUVH8YdhZYh69NscuKm3vCBn2ZuzEnkqJ0QRpq9v9nmbnBBk6/cobrS7+osADuFRfTd Tjx0YWbt9Q8EMWlb6rPVo6Rxij3YRX7G/JwgfmyAE9aHkJomWDCpGn3J/XRWwFRTlJ1O 5QxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=l6xQwfZDNH8MGLplWVDKDzFMqNG+bF5AG03cC166d5w=; b=iIOOe7e4dwOdg4AyTwGUUg/WRMiXsN3wapP33bGjn12/FO1eoyfwvfOzG6IpC4peCc 9C0lzrNtEGi7WCX7BcRNJaB/TyARiMwqjW4nu/3NtJ3u9NpAWBpBUlanXN5t4q0+F5wP e/pp9fr62gTKFx8ZdlbHbpQglmRKe0lgH0/kuXxQfsT+yf1KoWQLCnMaASnuwfRQwhOd v7OEB1lZAgHgBExjYi56xEsTdZ5G1tagBNiZSl67XPIV9YDDbLQKa5p2W+Z59rtmzw4s oSMwSMc7JFRc6dK2cxWxXOXV8vaNSLtR8J1yo8UZjX/wVsjuF8EV7zn+/n8HaXTG23lF S3kg== X-Gm-Message-State: APjAAAXFmAxYaV7R5lZU3FQrYvwKSKKv3rL+JU9NjuG+szxy1bqFKFv5 KCIqzqS3xn9ujAdsuXo6/1zSU9CM/CRXPgS8t3XOIJ5m X-Google-Smtp-Source: APXvYqyCGfbUMG0D09rxDctdnJd5r9nn8p+AUXavIHEu4XO542fsDl/1tj7NUXESnmIArFsa/2lEJUWN53BBMJ7ufDQ= X-Received: by 2002:a17:906:58d:: with SMTP id 13mr79902761ejn.36.1558959630437; Mon, 27 May 2019 05:20:30 -0700 (PDT) MIME-Version: 1.0 References: <1557201351160-0.post@n6.nabble.com> <1558929767100-0.post@n6.nabble.com> In-Reply-To: <1558929767100-0.post@n6.nabble.com> From: Ilya Kasnacheev Date: Mon, 27 May 2019 15:20:19 +0300 Message-ID: Subject: Re: Get tables from metadata errors. To: user@ignite.apache.org Content-Type: multipart/alternative; boundary="000000000000fdd28a0589dd92ef" --000000000000fdd28a0589dd92ef Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello! Does it work for you if you do it outside of the pool? Maybe you can always acquire a new connection for meta-data queries as a work-around? Regards, --=20 Ilya Kasnacheev =D0=BF=D0=BD, 27 =D0=BC=D0=B0=D1=8F 2019 =D0=B3. =D0=B2 07:18, yangjiajun <= 1371549332@qq.com>: > Hello! Thanks for u reply. > > I use HikariCP connection pool so I always get connection from the pool a= nd > return it after I use it.Finally I use two separated pool to avoid this > error. > > > ilya.kasnacheev wrote > > Hello! > > > > Only thing I can think of that maybe you're not releasing your > connections > > properly, end up using same connection from two threads at the same tim= e. > > > > Regards, > > -- > > Ilya Kasnacheev > > > > > > =D0=B2=D1=82, 7 =D0=BC=D0=B0=D1=8F 2019 =D0=B3. =D0=B2 07:03, yangjiaju= n < > > > 1371549332@ > > >>: > > > >> Hello. > >> > >> I use jdbc thin connections.I also use HikariCP 3.3.1. > >> I use flowing code to check if a table exists: > >> > >> try (ResultSet rs =3D conn.getMetaData().getTables( > >> null, null, tableName, new String[] > >> {"TABLE"})) { > >> return rs.next(); > >> } > >> > >> But it sometimes throws exception: > >> java.lang.ClassCastException: > >> > >> > org.apache.ignite.internal.processors.odbc.jdbc.JdbcOrderedBatchExecuteRe= sult > >> cannot be cast to > >> org.apache.ignite.internal.processors.odbc.jdbc.JdbcMetaTablesResult a= t > >> > >> > org.apache.ignite.internal.jdbc.thin.JdbcThinDatabaseMetadata.getTables(J= dbcThinDatabaseMetadata.java:743) > >> > >> My ignite version is 2.7.0.How can I get rid of such issue? > >> > >> > >> > >> -- > >> Sent from: http://apache-ignite-users.70518.x6.nabble.com/ > >> > > > > > > -- > Sent from: http://apache-ignite-users.70518.x6.nabble.com/ > --000000000000fdd28a0589dd92ef Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello!

Does it work for you = if you do it outside of the pool? Maybe you can always acquire a new connec= tion for meta-data queries as a work-around?

R= egards,
-= -
Ilya Kasnacheev


=D0=BF=D0=BD, 27 =D0=BC=D0=B0=D1=8F 2019 =D0=B3. =D0=B2 = 07:18, yangjiajun <1371549332@qq.co= m>:
Hello= ! Thanks for u reply.

I use HikariCP connection pool so I always get connection from the pool and=
return it after I use it.Finally I use two separated pool to avoid this
error.


ilya.kasnacheev wrote
> Hello!
>
> Only thing I can think of that maybe you're not releasing your con= nections
> properly, end up using same connection from two threads at the same ti= me.
>
> Regards,
> --
> Ilya Kasnacheev
>
>
> =D0=B2=D1=82, 7 =D0=BC=D0=B0=D1=8F 2019 =D0=B3. =D0=B2 07:03, yangjiaj= un <

> 1371549332@

>>:
>
>> Hello.
>>
>> I use jdbc thin connections.I also use HikariCP 3.3.1.
>> I use flowing code to check if a table exists:
>>
>> try (ResultSet rs =3D conn.getMetaData().getTables(
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0null, null, tableName, = new String[]
>> {"TABLE"})) {
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0return rs.next();
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>>
>> But it sometimes throws exception:
>> java.lang.ClassCastException:
>>
>> org.apache.ignite.internal.processors.odbc.jdbc.JdbcOrderedBatchEx= ecuteResult
>> cannot be cast to
>> org.apache.ignite.internal.processors.odbc.jdbc.JdbcMetaTablesResu= lt at
>>
>> org.apache.ignite.internal.jdbc.thin.JdbcThinDatabaseMetadata.getT= ables(JdbcThinDatabaseMetadata.java:743)
>>
>> My ignite version is 2.7.0.How can I get rid of such issue?
>>
>>
>>
>> --
>> Sent from: http://apache-ignite-users.70518.= x6.nabble.com/
>>





--
Sent from: http://apache-ignite-users.70518.x6.nabbl= e.com/
--000000000000fdd28a0589dd92ef--