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

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


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


                ps = conn.prepareStatement(ContestPersistenceImpl.DELETE_CONTEST);
                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 contest");
                }
            } finally {
                Database.dispose(ps);
            }
        } catch (PersistenceException e) {
            throw e;
        } catch (SQLException e) {
            throw new PersistenceException("Failed to delete contest.", e);
        } finally {
            Database.dispose(conn);
        }
    }
View Full Code Here

            List<AbstractContest> contests = new ArrayList<AbstractContest>();
            contests.add(contest);
            this.populatesLanguages(conn, contests);
            return contest;
        } catch (SQLException e) {
            throw new PersistenceException("Failed to get the contest with id " + id, e);
        } finally {
            Database.dispose(conn);
        }
    }
View Full Code Here

                Database.dispose(ps);
            }
            this.populatesLanguages(conn, contests);
            return contests;
        } catch (Exception e) {
            throw new PersistenceException("Failed to get the contests", e);
        } finally {
            Database.dispose(conn);
        }
    }
View Full Code Here

                }
            } finally {
                Database.dispose(ps);
            }
        } catch (SQLException e) {
            throw new PersistenceException("Failed to get last submit ip", e);
        } finally {
            Database.dispose(conn);
        }

    }
View Full Code Here

                } finally {
                    Database.dispose(ps);
                }
            }
        } catch (SQLException e) {
            throw new PersistenceException("Failed to set last submit ip", e);
        } finally {
            Database.dispose(conn);
        }
    }
View Full Code Here

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

            ps.addBatch();
          }
          ps.executeBatch();
         
    } catch (SQLException e) {
        throw new PersistenceException("Failed to save logs.", e);
    } finally {
        Database.dispose(ps);
        Database.dispose(conn);
      }  
  }
View Full Code Here

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

         
          logs.add(log);
        }
        return logs;
    } catch (SQLException e) {
        throw new PersistenceException("Failed to search logs.", e);
    } finally {
      Database.dispose(ps);
        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.