Package org.exolab.jms.persistence

Examples of org.exolab.jms.persistence.PersistenceException


            Statement statement = null;
            try {
                statement = _connection.createStatement();
                statement.executeUpdate(sql);
            } catch (SQLException exception) {
                throw new PersistenceException("Failed to drop table=" + name,
                                               exception);
            } finally {
                SQLHelper.close(statement);
            }
        }
View Full Code Here


            Statement statement = null;
            try {
                statement = _connection.createStatement();
                statement.execute(sql);
            } catch (SQLException exception) {
                throw new PersistenceException("Failed to delete from table="
                                               + name, exception);
            } finally {
                SQLHelper.close(statement);
            }
        }
View Full Code Here

            insert.setString(2, name);
            insert.setBoolean(3, isQueue);
            insert.executeUpdate();
            cache(destination, destinationId);
        } catch (SQLException exception) {
            throw new PersistenceException("Failed to add destination="
                                           + destination.getName(),
                                           exception);
        } finally {
            SQLHelper.close(insert);
        }
View Full Code Here

                    : (JmsDestination) new JmsTopic(name);
                destination.setPersistent(true);
                cache(destination, destinationId);
            }
        } catch (SQLException exception) {
            throw new PersistenceException("FGailed to load destinations",
                                           exception);
        } finally {
            SQLHelper.close(set);
            SQLHelper.close(select);
        }
View Full Code Here

            insert.setBoolean(4, consumer.isQueueConsumer());
            insert.executeUpdate();

            addSubscriptions(consumerId, consumer);
        } catch (SQLException exception) {
            throw new PersistenceException("Failed to add consumer",
                                           exception);
        } finally {
            SQLHelper.close(insert);
        }
    }
View Full Code Here

                    result = new Consumer(name, clientId);
                }
                getSubscriptions(consumerId, result);
            }
        } catch (SQLException exception) {
            throw new PersistenceException("Failed to get consumer",
                                           exception);
        } finally {
            SQLHelper.close(set);
            SQLHelper.close(select);
        }
View Full Code Here

            while (set.next()) {
                long consumerId = set.getLong("consumer_id");
                result.add(new Long(consumerId));
            }
        } catch (SQLException exception) {
            throw new PersistenceException(
                    "Failed to retrieve consumer identifiers", exception);
        } finally {
            SQLHelper.close(set);
            SQLHelper.close(select);
        }
View Full Code Here

        while (iterator.hasNext()) {
            Subscription subscription = (Subscription) iterator.next();
            long destinationId = _destinations.getId(
                    subscription.getDestination());
            if (destinationId == -1) {
                throw new PersistenceException(
                        "Destination identifier not found for destination="
                        + subscription.getDestination().getName());
            }

            PreparedStatement insert = null;
            try {
                insert = _connection.prepareStatement(
                        "insert into " + SUBSCRIPTION_TABLE + " values (?, ?)");

                insert.setLong(1, consumerId);
                insert.setLong(2, destinationId);
                insert.executeUpdate();
            } catch (SQLException exception) {
                throw new PersistenceException("Failed to insert subscription",
                                               exception);
            } finally {
                SQLHelper.close(insert);
            }
View Full Code Here

                insert.setLong(2, destinationId);
                insert.setLong(3, consumerId);
                insert.setBoolean(4, message.getDelivered());
                insert.executeUpdate();
            } catch (SQLException exception) {
                throw new PersistenceException(
                        "Failed to insert subscription state", exception);
            } finally {
                SQLHelper.close(insert);
            }
        }
View Full Code Here

            set = select.executeQuery();
            while (set.next()) {
                long destinationId = set.getLong("destination_id");
                JmsDestination destination = _destinations.get(destinationId);
                if (destination == null) {
                    throw new PersistenceException(
                            "Failed to locate destination for id="
                            + destinationId);
                }
                Subscription subscription = new Subscription(destination);
                getMessages(consumerId, destinationId, subscription);
                consumer.addSubscription(subscription);
            }
        } catch (SQLException exception) {
            throw new PersistenceException(
                    "Failed to get subscriptions for consumer=" + consumerId,
                    exception);
        } finally {
            SQLHelper.close(set);
            SQLHelper.close(select);
View Full Code Here

TOP

Related Classes of org.exolab.jms.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.