Hi,

DB object case sensitivity is the Ignite scourge.

When cache name is used as schema name (the schema doesn't define explicitly for a cache) the schema name is case sensitive.

In your case you can fix it:

- use schema name "ksdata", e.g. conn.setSchema("\"ksdata\"");
- or rename cache to "KSDATA" (use uppercase in config).
- or use CacheConfiguration#setSqlSchema (please read javadoc [1]).

[1]. https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/configuration/CacheConfiguration.html#setSqlSchema-java.lang.String-
06.12.2018 14:06, Philippe CEROU пишет:

Hi all,

I’m new to Ignite and I’ve this problem, I want to reate/declare a simple schema whit name « KSDATA » in IGNITE XML [default-config.xml].

Here is what I have :

[centos@ip-10-200-2-102 ~]$ cat /opt/app/ignite/2.7.0/config/default-config.xml

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd";>

  <!--

                                Alter configuration below as needed.

                -->

  <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">

    <property name="discoverySpi">

      <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">

        <property name="ipFinder">

          <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">

            <property name="addresses">

              <list>

<value>10.200.2.102</value><value>10.200.2.105</value><value>10.200.4.103</value><value>10.200.4.106</value><value>10.200.6.101</value><value>10.200.6.104</value>

              </list>

            </property>

          </bean>

        </property>

      </bean>

    </property>

    <property name="dataStorageConfiguration">

      <bean class="org.apache.ignite.configuration.DataStorageConfiguration">

        <property name="defaultDataRegionConfiguration">

          <bean class="org.apache.ignite.configuration.DataRegionConfiguration">

            <property name="persistenceEnabled" value="true"/>

          </bean>

        </property>

      </bean>

    </property>

    <property name="communicationSpi">

      <bean class="org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi">

        <property name="localPort" value="4321"/>

      </bean>

    </property>

    <property name="authenticationEnabled" value="true"/>

  </bean>

  <bean id="cache-template-bean" abstract="true" class="org.apache.ignite.configuration.CacheConfiguration">

    <property name="name" value="ksdata"/>

    <property name="cacheMode" value="PARTITIONED" />

    <property name="backups" value="1" />

  </bean>

</beans>

When I use JDBC client (client & server 2.6.0 or 2.7.0) It seems conenct well but any SQL is not run with following java exception :

...

drop table if exists benchmark

_java.sql.SQLException_: Failed to set schema for DB connection for thread [schema=KSDATA]

at org.apache.ignite.internal.jdbc.thin.JdbcThinConnection.sendRequest(_JdbcThinConnection.java:750_)

at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute0(_JdbcThinStatement.java:212_)

at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute(_JdbcThinStatement.java:475_)

at com.gfi.rt.lib.database.connectors.jdbc.CxObjJDBC.ExecuteDML(_CxObjJDBC.java:238_)

at com.gfi.rt.lib.database.connectors.jdbc.CxObjJDBC.TableDrop(_CxObjJDBC.java:659_)

at com.gfi.rt.lib.database.connectors.CxTable.drop(_CxTable.java:114_)

at com.gfi.rt.lib.database.connectors.CxTable.drop(_CxTable.java:122_)

at com.gfi.rt.bin.database.dbbench.BenchmarkMain.launch(_BenchmarkMain.java:248_)

at com.gfi.rt.bin.database.dbbench.BenchmarkMain.<init>(_BenchmarkMain.java:100_)

at com.gfi.rt.bin.database.dbbench.BenchmarkMain.main(_BenchmarkMain.java:42_)

create table benchmark (id NUMERIC(10) primary key,C001 VARCHAR(30),C002 float,C003 float,C004 NUMERIC(10),C005 NUMERIC(10),C006 NUMERIC(10),C007 NUMERIC(10),C008 NUMERIC(10),C009 VARCHAR(30),C010 VARCHAR(30),C011 DATE,C012 VARCHAR(30),C013 VARCHAR(30),C014 VARCHAR(30),C015 NUMERIC(10),C016 float,C017 VARCHAR(30),C018 VARCHAR(30),C019 VARCHAR(30)) WITH "backups=1, affinityKey=id"

_java.sql.SQLException_: Failed to set schema for DB connection for thread [schema=KSDATA]

at org.apache.ignite.internal.jdbc.thin.JdbcThinConnection.sendRequest(_JdbcThinConnection.java:750_)

at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute0(_JdbcThinStatement.java:212_)

at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute(_JdbcThinStatement.java:475_)

at com.gfi.rt.lib.database.connectors.jdbc.CxObjJDBC.ExecuteDML(_CxObjJDBC.java:238_)

at com.gfi.rt.lib.database.connectors.jdbc.CxObjJDBC.TableCreate(_CxObjJDBC.java:634_)

at com.gfi.rt.lib.database.connectors.CxTable.create(_CxTable.java:63_)

at com.gfi.rt.lib.database.connectors.CxTable.create(_CxTable.java:71_)

at com.gfi.rt.bin.database.dbbench.BenchmarkMain.launch(_BenchmarkMain.java:269_)

at com.gfi.rt.bin.database.dbbench.BenchmarkMain.<init>(_BenchmarkMain.java:100_)

at com.gfi.rt.bin.database.dbbench.BenchmarkMain.main(_BenchmarkMain.java:42_)

create index benchmarkc001 on benchmark(c001)

_java.sql.SQLException_: Table doesn't exist: BENCHMARK

at org.apache.ignite.internal.jdbc.thin.JdbcThinConnection.sendRequest(_JdbcThinConnection.java:750_)

at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute0(_JdbcThinStatement.java:212_)

at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute(_JdbcThinStatement.java:475_)

at com.gfi.rt.lib.database.connectors.jdbc.CxObjJDBC.ExecuteDML(_CxObjJDBC.java:238_)

at com.gfi.rt.lib.database.connectors.jdbc.CxObjJDBC.TableIndexCreate(_CxObjJDBC.java:647_)

at com.gfi.rt.lib.database.connectors.CxTable.addIndex(_CxTable.java:81_)

at com.gfi.rt.lib.database.connectors.CxTable.addIndexes(_CxTable.java:96_)

at com.gfi.rt.lib.database.connectors.CxTable.addIndexes(_CxTable.java:104_)

at com.gfi.rt.bin.database.dbbench.BenchmarkMain.launch(_BenchmarkMain.java:270_)

at com.gfi.rt.bin.database.dbbench.BenchmarkMain.<init>(_BenchmarkMain.java:100_)

at com.gfi.rt.bin.database.dbbench.BenchmarkMain.main(_BenchmarkMain.java:42_)

...

And so on ☹

Any full running java JDBC example will be welcome, or best my XML correction 😊

Cordialement,

*/—
NOTE : n/a/*
—
Gfi**Informatique
*Philippe Cerou*
Architecte & Expert Système
GFI Production / Toulouse
philippe.cerou @gfi.fr

—

1 Rond-point du Général Eisenhower, 31400 Toulouse

Tél. : +33 (0)5.62.85.11.55
Mob. : +33 (0)6.03.56.48.62
*www.gfi.world* <http://www.gfi.world/>

—

Facebook <https://www.facebook.com/gfiinformatique>Twitter <https://twitter.com/gfiinformatique>Instagram <https://www.instagram.com/gfiinformatique/>LinkedIn <https://www.linkedin.com/company/gfi-informatique>YouTube <https://www.youtube.com/user/GFIinformatique>
—
cid:image006.jpg@01D2F97F.AA6ABB50 <http://www.gfi.world/>

--
Taras Ledkov
Mail-To: tled...@gridgain.com

Reply via email to