Commit fb3a0b13 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Users creation is no longer done within a DB transaction.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@319 b35dd754-fafc-0310-a699-88a17e54d16e
parent 07df3d05
...@@ -93,9 +93,8 @@ public class UserManagerImpl extends BasicModule implements UserManager { ...@@ -93,9 +93,8 @@ public class UserManagerImpl extends BasicModule implements UserManager {
} }
Connection con = null; Connection con = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
boolean abortTransaction = false;
try { try {
con = DbConnectionManager.getTransactionConnection(); con = DbConnectionManager.getConnection();
pstmt = con.prepareStatement(INSERT_USER); pstmt = con.prepareStatement(INSERT_USER);
pstmt.setString(1, username); pstmt.setString(1, username);
pstmt.setString(2, password); pstmt.setString(2, password);
...@@ -108,12 +107,12 @@ public class UserManagerImpl extends BasicModule implements UserManager { ...@@ -108,12 +107,12 @@ public class UserManagerImpl extends BasicModule implements UserManager {
} }
catch (Exception e) { catch (Exception e) {
Log.error(LocaleUtils.getLocalizedString("admin.error"), e); Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
abortTransaction = true;
} }
finally { finally {
try { if (pstmt != null) { pstmt.close(); } } try { if (pstmt != null) { pstmt.close(); } }
catch (Exception e) { Log.error(e); } catch (Exception e) { Log.error(e); }
DbConnectionManager.closeTransactionConnection(con, abortTransaction); try { if (con != null) { con.close(); } }
catch (Exception e) { Log.error(e); }
} }
newUser = getUser(username); newUser = getUser(username);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment