Package cn.edu.zju.acm.onlinejudge.persistence

Examples of cn.edu.zju.acm.onlinejudge.persistence.PersistenceException


                }
            } finally {
                Database.dispose(ps);
            }
        } catch (SQLException e) {
            throw new PersistenceException("Failed to get the forum with id " + id, e);
        } finally {
            Database.dispose(conn);
        }
    }
View Full Code Here


                return users;
            } finally {
                Database.dispose(ps);
            }
        } catch (SQLException e) {
            throw new PersistenceException("Failed to get the user profile with create user " + userId, e);
        } finally {
            Database.dispose(conn);
        }
  }
View Full Code Here

                Database.dispose(ps);
            }
            conn.commit();
        } catch (Exception e) {
            Database.rollback(conn);
            throw new PersistenceException("Failed to create problem.", e);
        } finally {
            Database.dispose(conn);
        }
    }
View Full Code Here

                Database.dispose(ps);
            }
            conn.commit();
        } catch (Exception e) {
            Database.rollback(conn);
            throw new PersistenceException("Failed to create problem.", e);
        } finally {
            Database.dispose(conn);
        }
    }
View Full Code Here

                ps = conn.prepareStatement(ProblemPersistenceImpl.DELETE_PROBLEM);
                ps.setLong(1, user);
                ps.setTimestamp(2, new Timestamp(new Date().getTime()));
                ps.setLong(3, id);
                if (ps.executeUpdate() == 0) {
                    throw new PersistenceException("no such problem");
                }
            } finally {
                Database.dispose(ps);
            }
        } catch (PersistenceException pe) {
            throw pe;
        } catch (Exception e) {
            throw new PersistenceException("Failed to delete contest.", e);
        } finally {
            Database.dispose(conn);
        }
    }
View Full Code Here

                return problem;
            } finally {
                Database.dispose(ps);
            }
        } catch (SQLException e) {
            throw new PersistenceException("Failed to get the contest with id " + id, e);
        } finally {
            Database.dispose(conn);
        }
    }
View Full Code Here

                return problems;
            } finally {
                Database.dispose(ps);
            }
        } catch (SQLException e) {
            throw new PersistenceException("Failed to search the problems", e);
        } finally {
            Database.dispose(conn);
        }
    }
View Full Code Here

                }
            } finally {
                Database.dispose(ps);
            }
        } catch (SQLException e) {
            throw new PersistenceException("Failed to search the problems count", e);
        } finally {
            Database.dispose(conn);
        }
    }
View Full Code Here

                ps.executeUpdate();
            } finally {
                Database.dispose(ps);
            }
        } catch (SQLException e) {
            throw new PersistenceException("Failed to create role.", e);
        } finally {
            Database.dispose(conn);
        }
    }
View Full Code Here

            this.updateRolePermission("contest", role.getId(), role.getContestPermission(), conn);
            this.updateRolePermission("forum", role.getId(), role.getForumPermission(), conn);
            conn.commit();
        } catch (SQLException e) {
            Database.rollback(conn);
            throw new PersistenceException("Failed to update role.", e);
        } finally {
            Database.dispose(conn);
        }
    }
View Full Code Here

TOP

Related Classes of cn.edu.zju.acm.onlinejudge.persistence.PersistenceException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.