Connection Pooling with i-net OPTA, i-net MERLIA and i-net SEROPTO

  • Connection Pooling is a feature of the JDBC 2.0 Optional Package (formerly Standard Extension API).
  • i-net SPRINTA and i-net SERO supports the JDBC 2.0 Core API, only.
  • i-net OPTA and i-net SEROPTO supports the JDBC 2.0 Core API and the JDBC 2.0 Optional Package.
  • i-net MERLIA supports the JDBC 3.0 API. The JDBC 3.0 API includes the JDBC 2.0 Optional Package.

How can I use Connection Pooling with i-net OPTA ?

  • The simplest solution is to use the JDBC subprotocol “inetpool”. You need to change the subprotocol in your source code (sample PooledDriver.java), only.
  • You can create a DataSource and call a pool manager. You can use the pool manger i-net Plexa (sample WithPoolManager.java)
  • You can request a DataSource from a directory and call a pool manger (sample WithJndiAndPoolManager.java)
  • You can use a XADataSouce with an application server like J2EE (sample sample/xa)

Which solution should I use for Connection Pooling?

This question concerns the environment of your Java Application.

  • If you have an old application that already uses a JDBC driver with the DriverManger then you should use the pooled driver. You only need to change the JDBC url and the Class.forName() parameter.
  • If you have a standalone application and you want to use a different driver that supports ConnectionPoolDataSource or DataSource then the solution with PoolManager and PDataSource is the best solution.
  • If you use an application server (like J2EE) then you should use the enviroment of the application with the XADataSource (see sample sample.xa).

How can I return a connection to the pool?

You call Connection.close(). This returns the connetion to the pool and doesn't close the real connection.

How can I map a connection in another program part?

The default pool manager is a static instance. It maps the connections to all program parts in one JVM.

How can I set the maximum connection count?(With pooled driver or i-net PLEXA as pool manager)

If you call: PoolManager.getDefault(); you receive the defaut instance of the pool manager i-net PLEXA . This instance is using from the pooled driver. You can config the pool manager with its API now.

How can be checked if the pooled driver does work correctly?

The pooled driver (subprotocol inetpool) uses com.inet.pool.PoolManager.getDefault(); internally. If you request this instance of the PoolManager i-net PLEXA? you can control the pooled driver via the API of the PoolManager.

Do I have to purchase i-net PLEXA?

No, i-net PLEXA comes with i-net OPTA, i-net SEROPTO and i-net MERLIA. i-net PLEXA cannot be purchased separately.  

What are the differences between PoolManager i-net PLEXA and the pooled driver?

There are no major differences like performance or feature. The used API is in general a matter of taste. Both solutions are for a standalone application. In an application server you should use the feature of the application server.

pooled driver i-net PLEXA
- The driver creates a new ConnectionPoolDataSource every time + You can create a static global ConnectionPoolDataSource.
+ You can use it with an existing Application. You only need to change the JDBC URL. - In an existing application you need to change the getConnection() calls.
- If you use another driver (other than i-net software) then you must register both drivers. + The ConnectionPoolDataSource of the driver registeres the needed drivers automatically. You do not need to register any drivers.
- You only use one instance of i-net PLEXA (default instance). (This does not mean not multiple pools) + You can create multiple instances of i-net PLEXA. (This does not mean multiple pools)
+ You can remove the pooling very simple. You only need to change the JDBC URL. - You must modify your program. For example to change to a non pooled DataSource.
 

© Copyright 1996 - 2024, i-net software; All Rights Reserved.