Revision 44:7a7fb8fcfd6e src/my/com/upass/maybank/MaybankFacadeImpl.java

View differences:

src/my/com/upass/maybank/MaybankFacadeImpl.java
204 204
			session = HibernateUtils.currentSession();
205 205
			session.beginTransaction();
206 206

  
207
			rc = upcV2.deleteUser(appAccessId, hashedSecretKey, username, session);
208
			session.getTransaction().commit();
207
			rc = upcV2.deleteUserWithTheProfile(appAccessId, hashedSecretKey, username, session);
208

  
209
			if (rc == MinimalConstants.ERR_SUCCESS)
210
				session.getTransaction().commit();
211
			else
212
				GenericDAOHibernate.rollbackTransactionIfAny(session);
213

  
214
		} catch (UPassException e) {
215
			rc = e.getErrorCode();
216
			e.printStackTrace();
217
			GenericDAOHibernate.rollbackTransactionIfAny(session);
209 218

  
210 219
		} catch (Exception e) {
211 220
			LOGGER.error(e, e);
......
280 289
				int rc = upcV2.updateProfileShallowly(
281 290
						appAccessId, hashedSecretKey, stockUser, session);
282 291

  
283
				session.getTransaction().commit();
292
				if (rc == MinimalConstants.ERR_SUCCESS)
293
					session.getTransaction().commit();
294
				else
295
					GenericDAOHibernate.rollbackTransactionIfAny(session);
296

  
284 297
				return rc;
285 298

  
286 299
			} else {
......
319 332
			if (rc == MinimalConstants.ERR_SUCCESS) {
320 333
				rc = upcV2.updateProfileShallowly(appAccessId, hashedSecretKey, profile, session);
321 334

  
322
				session.getTransaction().commit();
335
				if (rc == MinimalConstants.ERR_SUCCESS)
336
					session.getTransaction().commit();
337
				else
338
					GenericDAOHibernate.rollbackTransactionIfAny(session);
323 339

  
324 340
			} else
325 341
				GenericDAOHibernate.rollbackTransactionIfAny(session);

Also available in: Unified diff