ThingWorx Model Definition and Composer > Data Storage > Persistence Providers > Using H2 as the Persistence Provider
  
Using H2 as the Persistence Provider
H2 is an open source Java SQL database. The H2 persistence provider supports both model and data providers.
Using H2
1. If you want to create additional persistence provider instances in ThingWorx that will connect the H2 data store, go to DATA STORAGE > Persistence Providers, and click New.
2. On the General Information screen, enter a name for the persistence provider.
3. In the Persistence Provider Package field, use the magic picker to select the H2 persistence provider package.
4. Click Configuration and configure the following settings to connect to H2:
Name
Default Value
Notes
Initial Connection Pool Size
5
Number of connections a pool will try to acquire upon startup
Connection Acquire Increment
5
Determines how many connections will be acquired when the pool is exhausted
Max Connection Pool Size
100
Maximum number of connections a pool maintains at any given time
Min Connection Pool Size
5
Minimum number of connections a pool maintains at any given time
Max Cached Statements
100
Size of global PreparedStatement cache
Acquire Retry Attempts
3
Defines how many times the connection pool will try to acquire a new connection
Acquire Retry Delay
10000
Time in milliseconds in which the connection pool will wait between acquire attempts
Checkout Retry Timeout
1000000
Number of milliseconds a client calling getConnection will wait for a connection to be checked in or acquired when the pool is exhausted
Max Idle Time
0
Seconds a connection can remain pooled but unused before being discarded. Zero means idle connections never expire.
Max Connection Age
0
Connections older than this time, in seconds, will be destroyed and purged from the pool. Zero means no maximum age is enforced.
Number of Helper Threads
8
Slow JDBC operations are generally performed by helper threads that do not hold contended locks. Spreading these operations over multiple threads can significantly improve performance by allowing multiple operations to be performed simultaneously.
Unreturned Connection Timeout
0
If the application acquires a connection but failed to close it within the specified period of time, in seconds, the pool will destroy the connection. Zero means no timeout, and the applications are expected to close their own connections.
Max Idle Time for Excess Connections
300
Number of seconds that connections in excess of minPoolSize should be permitted to remain idle in the pool before being destroyed. Zero means no enforcement and excess connections are not destroyed.
Max Cached Statements Per Connection
50
You should not change this value since it is tuned to the number of frequently-used statements in the code. It is the number of prepared statements that c3p0 will cache for a single-pooled connection. If both maxStatements and maxStatementsPerConnection are zero, statement caching will not be enabled. If maxStatementsPerConnection is zero but maxStatements is a non-zero value, statement caching will be enabled, and a global limit will be enforced. Otherwise, no limit will be set on the number of cached statements for a single connection.
If set, maxStatementsPerConnection should be set to the number of distinct prepared statements that are used frequently in your application, plus two or three extra so infrequent statements do not force the common cached statements to be called.
Although maxStatements is the JDBC standard parameter for controlling statement caching, users may find maxStatementsPerConnection more intuitive to use.
Table Lock Timeout
10000
The number of seconds until a lock timeout exception is thrown.
5. If necessary, migrate entities and data.
6. Monitor and maintain your H2 implementation.
* 
The platform-settings.json file is optional for H2. It is available for administrators to adjust settings for fine-tuning.