ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manu <maxn...@hotmail.com>
Subject Re: Ignite Jdbc connection
Date Mon, 24 Oct 2016 12:42:38 GMT

as you know, org.apache.ignite.internal.jdbc2.JdbcConnection is an
implementation of java.sql.Connection, works always on client mode (this
flag is hardcoded to true when load xml configuration passed on connection
url) and works on read mode (only select). On same java VM instance,
connection (ignite instance) is cached internally in JdbcConnection by url,
so for same connection (type, path, collocation...) you only have (and need)
one ignite instance. For more info check this 

As a java.sql.Connection, you could use a javax.sql.DataSource
implementation to manage it and checks connection status (validation query)
etc, but you don't need a pool, for example:

		<spring:bean id="collocatedDbcpIgniteDataGridDataSource"
destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource">
		    <spring:property name="driverClassName"
		    <spring:property name="url"
		    <spring:property name="validationQuery" value="select count(*) from
&quot;default&quot;.string limit 1"/>
		    <spring:property name="removeAbandoned" value="true"/>
		    <spring:property name="removeAbandonedTimeout" value="300"/>
		    <spring:property name="logAbandoned" value="true"/>

This is client ignite configuration with default cache (dummy, without data,
only used to validate client connection) used on url of

	<bean  id="ignite.client.default.cfg.jdbc"
		<property name="clientMode" value="true" />
		<property name="peerClassLoadingEnabled" value="false" />
		<property name="metricsLogFrequency" value="0"/>
	    <property name="cacheConfiguration">
				<bean class="org.apache.ignite.configuration.CacheConfiguration">
					<property name=&quot;name&quot; value=&quot;&lt;b>default*" />
					<property name="cacheMode" value="PARTITIONED" />
					<property name="indexedTypes">

View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-Jdbc-connection-tp8431p8436.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

View raw message