> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# JdbcPingDiscoveryProtocol

<span id="atoti_jdbc.JdbcPingDiscoveryProtocol" />

> atoti\_jdbc.JdbcPingDiscoveryProtocol(<br />
>     *url*: Annotated\[[str](https://docs.python.org/3/library/stdtypes.html#str), AfterValidator(normalize\_jdbc\_url)],<br />
>     \*,<br />
>     *driver*: Annotated\[[str](https://docs.python.org/3/library/stdtypes.html#str) | [None](https://docs.python.org/3/library/constants.html#None), AfterValidator(\_validate\_driver)] = `None`,<br />
>     *username*: [str](https://docs.python.org/3/library/stdtypes.html#str),<br />
>     *password*: [str](https://docs.python.org/3/library/stdtypes.html#str),<br />
>     *delete\_single\_sql*: [str](https://docs.python.org/3/library/stdtypes.html#str) | [None](https://docs.python.org/3/library/constants.html#None) = `None`,<br />
>     *initialize\_sql*: [str](https://docs.python.org/3/library/stdtypes.html#str) | [None](https://docs.python.org/3/library/constants.html#None) = `None`,<br />
>     *insert\_single\_sql*: [str](https://docs.python.org/3/library/stdtypes.html#str) | [None](https://docs.python.org/3/library/constants.html#None) = `None`,<br />
>     *remove\_all\_data\_on\_view\_change*: [bool](https://docs.python.org/3/library/functions.html#bool) = `True`,<br />
>     *remove\_old\_coords\_on\_view\_change*: [bool](https://docs.python.org/3/library/functions.html#bool) = `True`,<br />
>     *select\_all\_pingdata\_sql*: [str](https://docs.python.org/3/library/stdtypes.html#str) | [None](https://docs.python.org/3/library/constants.html#None) = `None`,<br />
>     *update\_store\_on\_view\_change*: [bool](https://docs.python.org/3/library/functions.html#bool) | [None](https://docs.python.org/3/library/constants.html#None) = `None`,<br />
>     *write\_data\_on\_find*: [bool](https://docs.python.org/3/library/functions.html#bool) = `True`,<br />
> )

Discovery protocol relying on a JDBC connection.

The set of nodes is stored in a database table, allowing each node to join the cluster without having to know any other node.

### Attributes

<h4 id="atoti_jdbc.JdbcPingDiscoveryProtocol.username">
  *username*
</h4>

> [str](https://docs.python.org/3/library/stdtypes.html#str)

<h4 id="atoti_jdbc.JdbcPingDiscoveryProtocol.password">
  *password*
</h4>

> [str](https://docs.python.org/3/library/stdtypes.html#str)

<h4 id="atoti_jdbc.JdbcPingDiscoveryProtocol.delete_single_sql">
  *delete\_single\_sql*
</h4>

> [str](https://docs.python.org/3/library/stdtypes.html#str) | [None](https://docs.python.org/3/library/constants.html#None)

<h4 id="atoti_jdbc.JdbcPingDiscoveryProtocol.initialize_sql">
  *initialize\_sql*
</h4>

> [str](https://docs.python.org/3/library/stdtypes.html#str) | [None](https://docs.python.org/3/library/constants.html#None)

<h4 id="atoti_jdbc.JdbcPingDiscoveryProtocol.insert_single_sql">
  *insert\_single\_sql*
</h4>

> [str](https://docs.python.org/3/library/stdtypes.html#str) | [None](https://docs.python.org/3/library/constants.html#None)

<h4 id="atoti_jdbc.JdbcPingDiscoveryProtocol.remove_all_data_on_view_change">
  *remove\_all\_data\_on\_view\_change*
</h4>

“Defined by the FILE\_PING protocol.

See [http://jgroups.org/manual4/index.html#\_removal\_of\_zombie\_files](http://jgroups.org/manual4/index.html#_removal_of_zombie_files).

<h4 id="atoti_jdbc.JdbcPingDiscoveryProtocol.remove_old_coords_on_view_change">
  *remove\_old\_coords\_on\_view\_change*
</h4>

“Defined by the FILE\_PING protocol.

See [http://jgroups.org/manual4/index.html#\_removal\_of\_zombie\_files](http://jgroups.org/manual4/index.html#_removal_of_zombie_files).

<h4 id="atoti_jdbc.JdbcPingDiscoveryProtocol.select_all_pingdata_sql">
  *select\_all\_pingdata\_sql*
</h4>

> [str](https://docs.python.org/3/library/stdtypes.html#str) | [None](https://docs.python.org/3/library/constants.html#None)

<h4 id="atoti_jdbc.JdbcPingDiscoveryProtocol.update_store_on_view_change">
  *update\_store\_on\_view\_change*
</h4>

Defined by the FILE\_PING protocol.

When `True`, the coordinator updates the backend store (JDBC table) on every view change, including when members leave or crash.
If `False`, the table is only updated on joins.
Enabling this ensures stale entries from crashed nodes (zombies) are removed.

See [http://jgroups.org/manual4/index.html#\_jdbc\_ping](http://jgroups.org/manual4/index.html#_jdbc_ping).

<h4 id="atoti_jdbc.JdbcPingDiscoveryProtocol.driver">
  *driver*
</h4>

The Java class name of the [`driver`](./atoti_jdbc.driver#module-atoti_jdbc.driver) to use.

This defines Hibernate’s [DRIVER](https://javadoc.io/static/org.hibernate/hibernate-core/5.6.15.Final/org/hibernate/cfg/AvailableSettings.html#DRIVER) option.

Inferred from [`url`](#atoti_jdbc.JdbcPingDiscoveryProtocol.url) if `None`.

<h4 id="atoti_jdbc.JdbcPingDiscoveryProtocol.url">
  *url*
</h4>

The JDBC connection string of the database.

The `"jdbc"` scheme is optional but the database specific scheme (such as `"h2"`) is mandatory.
For instance:

* `"h2:/home/user/database/file/path;USER=username;PASSWORD=passwd"`
* `"postgresql://postgresql.db.server:5430/example?user=username&password=passwd"`

More examples can be found [here](https://www.baeldung.com/java-jdbc-url-format).

This defines Hibernate’s [URL](https://javadoc.io/static/org.hibernate/hibernate-core/5.6.15.Final/org/hibernate/cfg/AvailableSettings.html#URL) option.

<h4 id="atoti_jdbc.JdbcPingDiscoveryProtocol.write_data_on_find">
  *write\_data\_on\_find*
</h4>

“Defined by the FILE\_PING protocol.

See [http://jgroups.org/manual4/index.html#\_removal\_of\_zombie\_files](http://jgroups.org/manual4/index.html#_removal_of_zombie_files).
