railo.runtime.db
Class DatasourceManagerImpl

java.lang.Object
  extended by railo.runtime.db.DatasourceManagerImpl
All Implemented Interfaces:
DataSourceManager

public final class DatasourceManagerImpl
extends Object
implements DataSourceManager

this class handle multible db connection, transaction and logging


Constructor Summary
DatasourceManagerImpl(ConfigImpl c)
          constructor of the class
 
Method Summary
 void add(PageContext pc, ORMSession session)
           
 void begin()
          set state of transaction to begin
 void begin(int isolation)
          set state of transaction to begin
 void begin(String isolation)
          set state of transaction to begin
 void commit()
          commit hanging transaction
 void end()
          ends the manual commit state
 DatasourceConnection getConnection(PageContext pc, DataSource ds, String user, String pass)
          return a database connection matching to datsource name
 DatasourceConnection getConnection(PageContext pc, String _datasource, String user, String pass)
          return a database connection matching to datsource name
 boolean isAutoCommit()
           
 void release()
           
 void releaseConnection(PageContext pc, DatasourceConnection dc)
           
 void remove(DataSource datasource)
           
 void remove(String datasource)
           
 void rollback()
          rollback hanging transaction
 void savepoint()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatasourceManagerImpl

public DatasourceManagerImpl(ConfigImpl c)
constructor of the class

Parameters:
pc -
Method Detail

getConnection

public DatasourceConnection getConnection(PageContext pc,
                                          String _datasource,
                                          String user,
                                          String pass)
                                   throws PageException
Description copied from interface: DataSourceManager
return a database connection matching to datsource name

Specified by:
getConnection in interface DataSourceManager
_datasource - datasource whished
user - username to datasource
pass - password to datasource
Returns:
return a Db Connectio9n Object
Throws:
PageException

getConnection

public DatasourceConnection getConnection(PageContext pc,
                                          DataSource ds,
                                          String user,
                                          String pass)
                                   throws PageException
Description copied from interface: DataSourceManager
return a database connection matching to datsource name

Specified by:
getConnection in interface DataSourceManager
ds - datasource whished
user - username to datasource
pass - password to datasource
Returns:
return a Db Connectio9n Object
Throws:
PageException

add

public void add(PageContext pc,
                ORMSession session)
         throws PageException
Throws:
PageException

releaseConnection

public void releaseConnection(PageContext pc,
                              DatasourceConnection dc)
Specified by:
releaseConnection in interface DataSourceManager

begin

public void begin()
Description copied from interface: DataSourceManager
set state of transaction to begin

Specified by:
begin in interface DataSourceManager

begin

public void begin(String isolation)
Description copied from interface: DataSourceManager
set state of transaction to begin

Specified by:
begin in interface DataSourceManager
Parameters:
isolation - isolation level of the transaction

begin

public void begin(int isolation)
Description copied from interface: DataSourceManager
set state of transaction to begin

Specified by:
begin in interface DataSourceManager
Parameters:
isolation - isolation level of the transaction

rollback

public void rollback()
              throws DatabaseException
Description copied from interface: DataSourceManager
rollback hanging transaction

Specified by:
rollback in interface DataSourceManager
Throws:
DatabaseException

savepoint

public void savepoint()
               throws DatabaseException
Specified by:
savepoint in interface DataSourceManager
Throws:
DatabaseException

commit

public void commit()
            throws DatabaseException
Description copied from interface: DataSourceManager
commit hanging transaction

Specified by:
commit in interface DataSourceManager
Throws:
DatabaseException

isAutoCommit

public boolean isAutoCommit()
Specified by:
isAutoCommit in interface DataSourceManager
Returns:
return if manager is in autocommit mode or not

end

public void end()
Description copied from interface: DataSourceManager
ends the manual commit state

Specified by:
end in interface DataSourceManager

remove

public void remove(DataSource datasource)

remove

public void remove(String datasource)
Specified by:
remove in interface DataSourceManager

release

public void release()
Specified by:
release in interface DataSourceManager


Copyright © 2012 Railo