/** * Connect to the datasource. Through using a CCI ConnectionFactory. * Catch exceptions and re-throw as TopLink exceptions. */ public void connect(Login login, AbstractSession session) throws DatabaseException { session.startOperationProfile(SessionProfiler.CONNECT); session.incrementProfile(SessionProfiler.TlConnects); try { if (session.shouldLog(SessionLog.CONFIG, SessionLog.CONNECTION)) {// Avoid printing if no logging required. session.log(SessionLog.CONFIG, SessionLog.CONNECTION, "connecting", new Object[] { login }, this); } setLogin(login); this.setDatasourcePlatform((DatasourcePlatform)session.getDatasourceLogin().getDatasourcePlatform()); try { connect(login); setIsInTransaction(false); } catch (RuntimeException exception) { session.handleSevere(exception); } session.getEventManager().postConnect(this); incrementCallCount(session); try { buildConnectLog(session); } finally { decrementCallCount(); } } finally { session.endOperationProfile(SessionProfiler.CONNECT); } }