private void primDelete ( IEntityGroup group ) throws SQLException { Connection conn = null ; String deleteGroupSql = getDeleteGroupSql ( group ) ; String deleteMembershipSql = getDeleteMembersInGroupSql ( group ) ; try { conn = RDBMServices . getConnection ( ) ; Statement stmnt = conn . createStatement ( ) ; setAutoCommit ( conn , false ) ; try { if ( LOG . isDebugEnabled ( ) ) LOG . debug ( "RDBMEntityGroupStore.primDelete(): " + deleteMembershipSql ) ; stmnt . executeUpdate ( deleteMembershipSql ) ; if ( LOG . isDebugEnabled ( ) ) LOG . debug ( "RDBMEntityGroupStore.primDelete(): " + deleteGroupSql ) ; stmnt . executeUpdate ( deleteGroupSql ) ; } finally { stmnt . close ( ) ; } commit ( conn ) ; } catch ( SQLException sqle ) { rollback ( conn ) ; throw sqle ; } finally { try { setAutoCommit ( conn , true ) ; } finally { RDBMServices . releaseConnection ( conn ) ; } } }
Delete this entity from the database after first deleting its memberships . Exception SQLException - if we catch a SQLException we rollback and re - throw it .