}
BeanFactory beanFactory = ContextUtils.createBeanFactory(configurationFilePath, properties);
// create an account object, and bind it to the database
final UserAccountImpl userAccount = new UserAccountImpl();
userAccount.setFolder(infoImpl.getFolder());
userAccount.setBeanFactory(beanFactory);
userAccount.setPassword(password);
userAccount.setName(infoImpl.getName());
userAccount.setId(infoImpl.getId());
userAccount.setVersion(infoImpl.getVersion());
// initialize transaction management
PlatformTransactionManager transactionManager = (PlatformTransactionManager) beanFactory.getBean("userAccountTxManager");
TransactionTemplate transactionTemplate = new TransactionTemplate(transactionManager);
userAccount.setTransactionTemplate(transactionTemplate);
// load the account in a transaction
try {
transactionTemplate.execute(
new TransactionCallbackWithoutResult() {
public void doInTransactionWithoutResult(TransactionStatus status) {
UserAccountDAO userAccountDAO = userAccount.getUserAccountDAO();
userAccountDAO.loadAccount(userAccount);
}
}
);