Package org.odmg

Examples of org.odmg.Database.open()


    {
        // get facade instance
        Implementation odmg = OJB.getInstance();
        Database db = odmg.newDatabase();
        //open database
        db.open(databaseName, Database.OPEN_READ_WRITE);
        Transaction tx = odmg.newTransaction();

        //perform transaction
        try
        {
View Full Code Here


        //try open database with non existing repository file:
        String wrongDatabaseName = "ThereIsNoSuchFile";
        try
        {
            db.open(wrongDatabaseName, Database.OPEN_READ_WRITE);
            fail("should not be able to open database " + wrongDatabaseName);
        }
        catch (ODMGException ex)
        {
            return;
View Full Code Here

        String tablename = null;

        //open database
        try
        {
            db.open(databaseName, Database.OPEN_READ_WRITE);
        }
        catch (ODMGException ex)
        {
            fail("ODMGException: " + ex.getMessage());
        }
View Full Code Here

        try
        {
            if (log.isDebugEnabled())
                log.debug("open new database " +
                        db + " using databaseName name " + BeanConstants.DEF_DATABASE_NAME);
            db.open(BeanConstants.DEF_DATABASE_NAME, Database.OPEN_READ_WRITE);
        }
        catch (ODMGException e)
        {
            log.error("Database open failed", e);
            throw new OJBRuntimeException("Unable to open database using ODMG api", e);
View Full Code Here

            // get facade instance
            Implementation odmg = OJB.getInstance();
            Database db = odmg.newDatabase();
            //open database
            db.open(databaseName, Database.OPEN_READ_WRITE);

            tx1 = (TransactionImpl) odmg.newTransaction();
            tx2 = (TransactionImpl) odmg.newTransaction();
            tx1.begin();
            tx2.begin();
View Full Code Here

            // get facade instance
            Implementation odmg = OJB.getInstance();
            Database db = odmg.newDatabase();
            //open database
            db.open(databaseName, Database.OPEN_READ_WRITE);

            tx1 = (TransactionImpl) odmg.newTransaction();
            tx2 = (TransactionImpl) odmg.newTransaction();
            tx1.begin();
            tx2.begin();
View Full Code Here

        Implementation odmg = OJB.getInstance();
        Database db = odmg.newDatabase();
        String name = "testDuplicateInsertion_" + System.currentTimeMillis();
        String nameNew = "testDuplicateInsertion_New_" + System.currentTimeMillis();

        db.open(databaseName, Database.OPEN_READ_WRITE);
        //System.out.println("TEST: Database open");

        // insert an object with UNIQUE field NAME="A site"
        //System.out.println("TEST: Insert first object");
        newSite(odmg, name, 2, 1);
View Full Code Here

    {
        Implementation odmg = OJB.getInstance();
        Database db = odmg.newDatabase();
        String name = "testSimpleQueryDelete - " + System.currentTimeMillis();

        db.open(databaseName, Database.OPEN_READ_WRITE);
        Site site = new Site();
        site.setName(name);
        Transaction tx = odmg.newTransaction();
        tx.begin();
        tx.lock(site, Transaction.WRITE);
View Full Code Here

                restore = true;
                conf.setUseImplicitLocking(false);
            }
            Implementation odmg = OJB.getInstance();
            Database db = odmg.newDatabase();
            db.open(databaseName, Database.OPEN_READ_WRITE);

            String name = "testImplicitLocking - " + System.currentTimeMillis();
            String queryString = "select sites from " + Site.class.getName() + " where name = $1";

            /* Create an object */
 
View Full Code Here

          Implementation odmg = OJB.getInstance();
          Database db = odmg.newDatabase();
          //open database
          try
          {
            db.open(databaseName, Database.OPEN_READ_WRITE);
          }
          catch (ODMGException ex)
          {
            fail("ODMGException: " + ex.getMessage());
          }
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.