DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14983>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14983 GenericObjectPool should allow for manual population of the pool ------- Additional Comments From [EMAIL PROTECTED] 2003-03-14 15:30 ------- Something like addObject(Object) is also possible, which would address Quinton's request. I still think we want both versions of addObject to return void. Returning a reference to the object *and* adding it to the pool at the same time virtually guarantees we've got duplicate references to that object. In other words, something like: Session getSession() { //... if (makeSession) { Session aSession = new Session(); this.getPool().addObject(aSession); return aSession; } //... } is bad form, no matter what the syntax. Since the pool has a reference to the object, it may return it some client, and now we've got two folks using the same Session. (In this particular example, a PoolableObjectFactory implementation with "createObject() { return new Session(); }" is probably the right way to do it. Then your method reads: Session getSession() { //... if (makeSession) { return (Session)(this.getPool().borrowObject()); } //... } and whether it is created or recycled is hidden from you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
