
io.ebeaninternal.server.transaction.DataSourceSupplier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ebean Show documentation
Show all versions of ebean Show documentation
composite of common runtime dependencies for all platforms
package io.ebeaninternal.server.transaction;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;
/**
* Supply the DataSource to the transaction manager.
*
* Implementations can support multi-tenancy via DB or SCHEMA.
*
*/
public interface DataSourceSupplier {
/**
* Return the DataSource to use for the current request.
*
* This should take into account multi-tenancy and the current tenantId.
*
*/
DataSource getDataSource();
/**
* Return a connection from the DataSource taking into account a tenantId for multi-tenant lazy loading.
*
* @param tenantId Most often null but well supplied indicates a multi-tenant lazy loading query
* @return the connection to use
*/
Connection getConnection(Object tenantId) throws SQLException;
/**
* Shutdown the datasource de-registering the JDBC driver if requested.
*/
void shutdown(boolean deregisterDriver);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy