Re: New Object Pooling project

From: Dave Glasser (dglasser_at_pobox.com)
Date: 01/03/04

  • Next message: David Postill: "Re: retrieve multiple dadx from db2"
    Date: Sat, 03 Jan 2004 17:22:08 -0500
    
    

    "David Boyer" <boyedav@bvu.edu> wrote on Sat, 27 Dec 2003 18:04:49
    -0600 in comp.lang.java.softwaretools:

    >Hi all,
    >
    >I've released a beta of my Object Pooling software and it's freely available
    >on my web site:
    >
    >http://web.bvu.edu/staff/david/pooling/
    >
    >This is an extensible Object Pooling system that could be extendend to
    >handle pooling of just about any Object type. The initial release contains a
    >full database connection pooling system.
    >
    >The main distinction between this pooling system and the others I can find
    >is that there's no need to pre-configure the pools or use JNDI.

    I'm not sure what you mean by "pre-configure" the pools, but the
    pooling library that's part of the Apache Commons project is pretty
    simple. Here's a code snippet that creates a pooling
    javax.sql.DataSource, and it doesn't require JNDI:

    DriverConnectionFactory connFactory
        = new DriverConnectionFactory(driver, url, propertiess);

    GenericObjectPool genericPool = new GenericObjectPool(null,
    maxConnections);
    genericPool.setWhenExhaustedAction(genericPool.WHEN_EXHAUSTED_FAIL);
    PoolableConnectionFactory
        poolableConnectionFactory
        = new PoolableConnectionFactory(connFactory,
            genericPool,null, null, false, true);
    PoolingDataSource dataSource
        = new PoolingDataSource(genericPool);
    return dataSource;

    -- 
    Check out QueryForm, a free, open source, Java/Swing-based
    front end for relational databases.
    http://qform.sourceforge.net
    

  • Next message: David Postill: "Re: retrieve multiple dadx from db2"

    Relevant Pages

    • Re: Possible to re-initialize connection(s) after package has been recompiled?
      ... > pooling stuff, and the Websphere Server conn pooling mechanism). ... Problem is, each time I recompile the package, developers ... > start getting connections back from the db that they have to ... pooling system APIs to see if that is necessary, ...
      (comp.lang.java.databases)
    • Re: COM Interop and memory leaks
      ... I must use COM+ object pooling through ... Then handler instances in pool will be deactivated when IE ... with managed object pooling I mean you have to do your ... >>RegisterNameSpace. ...
      (microsoft.public.dotnet.framework.interop)
    • Re: Stateless objects
      ... If you are using pooling, the client may get a recycled instance - thus, it is your duty to clear all member variables when implementing IObjectControl to avoid another client retrieving a 'dirty' object. ... If I have a class installed in COM+, which has class level private variables, can the values be exposed to other users of the class if object pooling is not enabled. ... If UserB is using the same class is there a danger that UserB will be using values set by UserA or do they instantiate their own instance of the class. ...
      (microsoft.public.dotnet.framework.component_services)