Package org.apache.geronimo.timer

Examples of org.apache.geronimo.timer.PersistenceException


                            insertStatement.setLong(7, workInfo.getPeriod().longValue());
                        }
                        insertStatement.setBoolean(8, workInfo.getAtFixedRate());
                        int result = insertStatement.executeUpdate();
                        if (result != 1) {
                            throw new PersistenceException("Could not insert!");
                        }
                    } finally {
                        insertStatement.close();
                    }
                } else {
                    PreparedStatement insertStatement = c.prepareStatement(insertSQLWithIdentity);
                    try {
                        String serializedUserId = serialize(workInfo.getUserId());
                        String serializedUserKey = serialize(workInfo.getUserInfo());
                        insertStatement.setString(1, serverUniqueId);
                        insertStatement.setString(2, workInfo.getKey());
                        insertStatement.setString(3, serializedUserId);
                        insertStatement.setString(4, serializedUserKey);
                        insertStatement.setLong(5, workInfo.getTime().getTime());
                        if (workInfo.getPeriod() == null) {
                            insertStatement.setNull(6, Types.NUMERIC);
                        } else {
                            insertStatement.setLong(6, workInfo.getPeriod().longValue());
                        }
                        insertStatement.setBoolean(7, workInfo.getAtFixedRate());
                        int result = insertStatement.executeUpdate();
                        if (result != 1) {
                            throw new PersistenceException("Could not insert!");
                        }
                    } finally {
                        insertStatement.close();
                    }
                    long id;
                    PreparedStatement identityStatement = c.prepareStatement(identitySQL);
                    try {
                        ResultSet seqRS = identityStatement.executeQuery();
                        try {
                            seqRS.next();
                            id = seqRS.getLong(1);
                        } finally {
                            seqRS.close();
                        }
                    } finally {
                        identityStatement.close();
                    }
                    workInfo.setId(id);
                }
            } finally {
                c.close();
            }
        } catch (SQLException e) {
            throw new PersistenceException(e);
        }
    }
View Full Code Here


                }
            } finally {
                c.close();
            }
        } catch (SQLException e) {
            throw new PersistenceException(e);
        }

    }
View Full Code Here

                }
            } finally {
                c.close();
            }
        } catch (SQLException e) {
            throw new PersistenceException(e);
        }
    }
View Full Code Here

                }
            } finally {
                c.close();
            }
        } catch (SQLException e) {
            throw new PersistenceException(e);
        }
    }
View Full Code Here

                }
            } finally {
                c.close();
            }
        } catch (SQLException e) {
            throw new PersistenceException(e);
        }
    }
View Full Code Here

                }
            } finally {
                c.close();
            }
        } catch (SQLException e) {
            throw new PersistenceException(e);
        }
        return ids;
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.timer.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.