Package com.salas.bb.persistence

Examples of com.salas.bb.persistence.PersistenceException


                Throwable cause = e.getCause();
                if (cause instanceof SQLException &&
                    "08001".equals(((SQLException)cause).getSQLState()))
                {
                    // Database is already in use by another process
                    throw new PersistenceException(Strings.error("db.database.is.locked"), e);
                } else
                {
                    LOG.log(Level.SEVERE, Strings.error("db.was.unable.to.perform.migration"), e);

                    // Backup current database
View Full Code Here


                close(psLoadDataFeedPart);
                psLoadDataFeedPart = null;
            }
        } catch (SQLException e)
        {
            throw new PersistenceException(Strings.error("db.failed.to.load.data"), e);
        }
    }
View Full Code Here

                aFeed.setArticlesLimit(rs.getInt(3));
                aFeed.setRating(rs.getInt(4));
                aFeed.setDedupProperties(rs.getBoolean(5), rs.getInt(6), rs.getInt(Constants.DAYS_IN_WEEK));
            } else
            {
                throw new PersistenceException(MessageFormat.format(
                    Strings.error("db.feed.was.not.found.in.searchfeeds.table"), aFeedId));
            }
        } finally
        {
            rs.close();
View Full Code Here

                aFeed.setDedupEnabled(rs.getBoolean(4));
                aFeed.setDedupFrom(rs.getInt(5));
                aFeed.setDedupTo(rs.getInt(6));
            } else
            {
                throw new PersistenceException(MessageFormat.format(
                    Strings.error("db.feed.was.not.found.in.directfeeds.table"), feedId));
            }
        } finally
        {
            rs.close();
View Full Code Here

                {
                    String siteURL = rs.getString("SITEURL");
                    feed.setSiteURL(siteURL == null ? null : new URL(siteURL));
                } catch (MalformedURLException e)
                {
                    throw new PersistenceException(MessageFormat.format(
                        Strings.error("db.currupted.site.url.for.feed"), feedId));
                }

                try
                {
                    String xmlURL = rs.getString("XMLURL");
                    feed.setXmlURL(xmlURL == null ? null : new URL(xmlURL));
                } catch (MalformedURLException e)
                {
                    throw new PersistenceException(MessageFormat.format(
                        Strings.error("db.currupted.xml.url.for.feed.0"), feedId));
                }

                feed.setBaseTitle(rs.getString("TITLE"));
                feed.setBaseAuthor(rs.getString("AUTHOR"));
                feed.setBaseDescription(rs.getString("DESCRIPTION"));
                feed.setCustomTitle(rs.getString("CUSTOMTITLE"));
                feed.setCustomAuthor(rs.getString("CUSTOMAUTHOR"));
                feed.setCustomDescription(rs.getString("CUSTOMDESCRIPTION"));
                feed.setDead(rs.getBoolean("DEAD"));
                feed.setInLinks(rs.getInt("INLINKS"));
                feed.setLastMetaDataUpdateTime(rs.getLong("LASTMETADATAUPDATETIME"));
                feed.setUserTags(StringUtils.keywordsToArray(rs.getString("USERTAGS")));
                feed.setUnsavedUserTags(rs.getBoolean("UNSAVEDUSERTAGS"));
                feed.setTagsDescription(rs.getString("TAGSDESCRIPTION"));
                feed.setTagsExtended(rs.getString("TAGSEXTENDED"));
                feed.setDisabled(rs.getBoolean("DISABLED"));
                feed.setSyncHash(rs.getInt("SYNC_HASH"));
            } else
            {
                throw new PersistenceException(MessageFormat.format(
                    Strings.error("db.feed.was.not.found.in.directfeeds.table"), feedId));
            }
        } finally
        {
            rs.close();
View Full Code Here

                String[] keys = lfa == null ? new String[0] : StringUtils.split(lfa, ",");
                for (int i = 0; i < keys.length; i++) keys[i] = keys[i].intern();
                feed.setLastFetchArticleKeys(keys);
            } else
            {
                throw new PersistenceException(MessageFormat.format(
                    Strings.error("db.feed.was.not.found.in.datafeeds.table"), feedId));
            }
        } finally
        {
            rs.close();
View Full Code Here

                    insertGuideHierarchy(guide, position);
                    commit();
                } catch (SQLException e)
                {
                    rollback();
                    throw new PersistenceException(Strings.error("db.failed.to.insert.guide.with.hierarchy"), e);
                }
            }
        }
    }
View Full Code Here

                    guidesManager.removeGuide(guide);
                    commit();
                } catch (SQLException e)
                {
                    rollback();
                    throw new PersistenceException(Strings.error("db.failed.to.remove.guide"), e);
                }
            }
        }
    }
View Full Code Here

            guidesManager.updateGuide(guide, position);
            commit();
        } catch (SQLException e)
        {
            rollback();
            throw new PersistenceException(Strings.error("db.failed.to.update.guide"), e);
        }
    }
View Full Code Here

            guidesManager.updateGuidePositions(set);
            commit();
        } catch (SQLException e)
        {
            rollback();
            throw new PersistenceException("Failed to update the guide positions.", e);
        }
    }
View Full Code Here

TOP

Related Classes of com.salas.bb.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.