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

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


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

        } catch(SQLException ex) {
View Full Code Here


            KiWiResource kr = (KiWiResource) ((r instanceof URI) ? getValueFactory().createURI(r.stringValue()) : getValueFactory().createBNode(r.stringValue()));

            try {
                return connection.getLatestVersion(kr,date);
            } finally {
                connection.commit();
                connection.close();
            }

        } catch(SQLException ex) {
            throw new SailException("database error while listing versions",ex);
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

            // check if listVersions with subject1 still gives exactly one version
            List<Version> listr2 = Iterations.asList(connection.listVersions(subject1));
            Assert.assertEquals("there should be exactly one version", 2, listr2.size());
            Assert.assertEquals("contents of version differ", version1, listr2.get(0));

            connection.commit();
        } finally {
            connection.close();
        }

    }
View Full Code Here

            KiWiTriple triple1 = new KiWiTriple(subject,pred_1,object_1,context);
            KiWiTriple triple2 = new KiWiTriple(subject,pred_2,object_2,context);

            connection.storeTriple(triple1);
            connection.storeTriple(triple2);
            connection.commit();

            Date date1 = new Date();

            // wait for one second to be sure to capture MySQL cutting milliseconds
            mysqlSleep();
View Full Code Here

            Version version1 = new Version();
            version1.setCommitTime(new Date());
            version1.addTriple(triple1);
            connection.storeVersion(version1);
            connection.commit();

            // wait for one second to be sure to capture MySQL cutting milliseconds
            mysqlSleep();

            Date date2 = new Date();
View Full Code Here

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

            // wait for one second to be sure to capture MySQL cutting milliseconds
            mysqlSleep();

            Date date3 = new Date();
View Full Code Here

            Assert.assertEquals("there should be exactly two versions from "+date1+" to "+date3,2,list4.size());
            Assert.assertEquals("contents of version1 differ", version1, list4.get(0));
            Assert.assertEquals("contents of version2 differ", version2, list4.get(1));


            connection.commit();
        } finally {
            connection.close();
        }

View Full Code Here

            KiWiTriple triple1 = new KiWiTriple(subject1,pred_1,object_1,context);
            KiWiTriple triple2 = new KiWiTriple(subject2,pred_2,object_2,context);

            connection.storeTriple(triple1);
            connection.storeTriple(triple2);
            connection.commit();

            Version version1 = new Version();
            version1.setCommitTime(new Date());
            version1.addTriple(triple1);
            connection.storeVersion(version1);
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.