I see this in initialize(): if (isOracle) { if (!StringUtils.isEmpty(ConfigurationManager.getProperty("db.postgres.schema"))) { sqlOnBorrow = "SET SEARCH_PATH TO " + ConfigurationManager.getProperty("db.postgres.schema").trim(); } }
Two things seem odd: o It's doubtful that this would ever do anything. Why would someone set db.postgres.schema if he's using Oracle? o Should we be using PostgreSQL settings in Oracle commands? I guess that this is setting up the query used to test the database connection when borrowing from the pool. I thought that the canonical validation query for Oracle was "SELECT 1 FROM DUAL". (For PostgreSQL I believe it's "SELECT 1".) Probably we should either just hardwire these or have a generic db.validationQuery string that's always set into the pool if it is coded. [digs a little deeper] In fact DataSourceInit.getDataSource() sets up the pool to use one of the "canonical" validation queries shown above. So the pool should be handling validation. DatabaseManager.getConnection() is doing an *additional* validation if sqlOnBorrow is not empty (and it may never be non-empty). It looks like there is wasted code we could remove from getDataSource(). Comments? BTW if you supply a ConnectionPool through JNDI you set it up however you may before handing it to DSpace, and all this is bypassed. So if you want a validation query in this case, you should be sure to set one. -- Mark H. Wood, Lead System Programmer mw...@iupui.edu Machines should not be friendly. Machines should be obedient.
signature.asc
Description: Digital signature
------------------------------------------------------------------------------ Android is increasing in popularity, but the open development platform that developers love is also attractive to malware creators. Download this white paper to learn more about secure code signing practices that can help keep Android apps secure. http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________ Dspace-devel mailing list Dspace-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-devel