1 Reply Latest reply on May 15, 2005 6:24 AM by jpulley1

    How to use a custom DataSource impl?

    jpulley1 Newbie

      We're a bit stuck on this one. Here's the context: We need to implement a JDBC connection pool that spreads its load across a horizontal tier of identical databases. The application feature we're supporting is a reporting system; when a new report is first executed all the results are prepared and cached in the database. Subsequently, the app retrieves results one block at a time from the cache. Almost a readonly situation, but not quite.

      So the desired solution will have a getConnection(...) that takes a parameter that identifies the report object. When a new report is observed, the pool will allocate a connection to the database node that is currently under the least load. Subsequent connections keyed by that report will return to the same database (because that's the node with the cache).

      Now the question. We can see how to do this with a custom JCA connector, but we're so darn lazy we'd rather just implement a ConnectionPoolDataSource. We're using JBoss 3.2, and the -ds.xml configurations require that we specify a Driver vice a DataSource. How do we tell JBoss to use our pooling DataSource?