Package org.apache.marmotta.kiwi.versioning.persistence

Examples of org.apache.marmotta.kiwi.versioning.persistence.KiWiVersioningConnection.commit()


            Version version2 = new Version();
            version2.setCommitTime(new Date());
            version2.addTriple(triple2);
            version2.removeTriple(triple1);
            connection.storeVersion(version2);
            connection.commit();

            // check if listVersions now gives exactly two versions
            List<Version> list2 = Iterations.asList(connection.listVersions());
            Assert.assertEquals("there should be exactly two version",2,list2.size());
            Assert.assertEquals("contents of version differ", version2, list2.get(1));
View Full Code Here


            // check if listVersions now gives exactly two versions
            List<Version> list2 = Iterations.asList(connection.listVersions());
            Assert.assertEquals("there should be exactly two version",2,list2.size());
            Assert.assertEquals("contents of version differ", version2, list2.get(1));

            connection.commit();

            connection.removeVersion(version1.getId());
            connection.commit();

            // check if listVersions now gives exactly two versions
View Full Code Here

            Assert.assertEquals("contents of version differ", version2, list2.get(1));

            connection.commit();

            connection.removeVersion(version1.getId());
            connection.commit();

            // check if listVersions now gives exactly two versions
            List<Version> list3 = Iterations.asList(connection.listVersions());
            Assert.assertEquals("there should be exactly one version",1,list3.size());
            Assert.assertEquals("contents of version differ", version2, list3.get(0));
View Full Code Here

            // check if listVersions now gives exactly two versions
            List<Version> list3 = Iterations.asList(connection.listVersions());
            Assert.assertEquals("there should be exactly one version",1,list3.size());
            Assert.assertEquals("contents of version differ", version2, list3.get(0));

            connection.commit();

        } finally {
            connection.close();
        }
View Full Code Here

                try {
                    final KiWiVersioningConnection connection = persistence.getConnection();
                    try {
                        connection.storeVersion(version);
                        connection.commit();
                    } catch (SQLException ex) {
                        log.warn("could not store versioning information (error: {}); rolling back...", ex.getMessage());
                        connection.rollback();
                    } finally {
                        connection.close();
View Full Code Here

                @Override
                protected void handleClose() throws RepositoryException {
                    super.handleClose();

                    try {
                        connection.commit();
                        connection.close();
                    } catch (SQLException ex) {
                        throw new RepositoryException("database error while committing/closing connection");
                    }
                }
View Full Code Here

                @Override
                protected void handleClose() throws RepositoryException {
                    super.handleClose();

                    try {
                        connection.commit();
                        connection.close();
                    } catch (SQLException ex) {
                        throw new RepositoryException("database error while committing/closing connection");
                    }
                }
View Full Code Here

        try {
            final KiWiVersioningConnection connection = persistence.getConnection();
            try {
                return connection.getVersion(id);
            } finally {
                connection.commit();
                connection.close();
            }

        } catch(SQLException ex) {
            throw new SailException("database error while listing versions",ex);
View Full Code Here

    public void removeVersion(Long id) throws SailException {
        try {
            final KiWiVersioningConnection connection = persistence.getConnection();
            try {
                connection.removeVersion(id);
                connection.commit();
            } finally {
                connection.close();
            }

        } catch(SQLException ex) {
View Full Code Here

    public void removeVersions(Date until) throws SailException {
        try {
            final KiWiVersioningConnection connection = persistence.getConnection();
            try {
                connection.removeVersions(until);
                connection.commit();
            } finally {
                connection.close();
            }

        } catch(SQLException ex) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.