001 package railo.runtime.db; 002 003 import railo.runtime.PageContext; 004 import railo.runtime.exp.PageException; 005 006 public interface DataSourceManager { 007 008 /** 009 * return a database connection matching to datsource name 010 * @param datasource datasource whished 011 * @param user username to datasource 012 * @param pass password to datasource 013 * @return return a Db Connectio9n Object 014 * @throws PageException 015 */ 016 public abstract DatasourceConnection getConnection(PageContext pc,String datasource, 017 String user, String pass) throws PageException; 018 019 public abstract void releaseConnection(PageContext pc,DatasourceConnection dc) throws PageException; 020 021 /** 022 * set state of transaction to begin 023 */ 024 public abstract void begin(); 025 026 /** 027 * set state of transaction to begin 028 * @param isolation isolation level of the transaction 029 */ 030 public abstract void begin(String isolation); 031 032 /** 033 * set state of transaction to begin 034 * @param isolation isolation level of the transaction 035 */ 036 public abstract void begin(int isolation); 037 038 /** 039 * rollback hanging transaction 040 * @throws DatabaseException 041 */ 042 public abstract void rollback() throws PageException; 043 044 /** 045 * commit hanging transaction 046 * @throws DatabaseException 047 */ 048 public abstract void commit() throws PageException; 049 050 /** 051 * @return return if manager is in autocommit mode or not 052 */ 053 public abstract boolean isAutoCommit(); 054 055 /** 056 * ends the manual commit state 057 */ 058 public abstract void end(); 059 060 public abstract void remove(String datasource); 061 062 // FUTURE public abstract void release(); 063 064 }