Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Java by sdf ( 13 years ago )
// ТЕПЕРЬ ВМЕСТО ТАКОГО КУСКА:
ConnectionManager connection = null;
try {
connection = new ConnectionManager();
connection.connectToDefaultOs();
return chiefDao.getChiefForOraganization(connection, organizationId);
} catch (OrgStructServiceException ose) {
throw ose;
} catch (Exception e) {
throw new OrgStructServiceException("re", e);
} finally {
if (connection != null) {
connection.disconnect();
}
}
// У МЕНЯ БУДЕТ ТАКОЙ КУСОК:
return ConnectionTemplate.connectAndexecute(new ConnectionTemplate.BusinessCallback<Chief>() {
@Override
public Chief connectAndExecute(ConnectionManager connection) throws Exception {
return chiefDao.getChiefForOraganization(connection, organizationId);
}
});
Revise this Paste
Parent: 61713