Package javax.jdo

Examples of javax.jdo.Transaction.begin()


    /** */
    protected void insertPCPoints(PersistenceManager pm, int numInsert) {
        Transaction tx = pm.currentTransaction();
        try {
            tx.begin();
            for(int i = 0; i<numInsert; i++) {
                Object pc = new PCPoint(i, i);
                pm.makePersistent(pc);
                inserted.add(pc);
            }
View Full Code Here


     * @param pm the PersistenceManager
     * @param pcInstances the pc instances to persist
     */
    private void makePersistentAll(PersistenceManager pm, List pcInstances) {
        Transaction tx = pm.currentTransaction();
        tx.begin();
        try {
            pm.makePersistentAll(pcInstances);
            if (debug) logger.debug("inserted " + pcInstances);
            tx.commit();
        } finally {
View Full Code Here

        char charValue = '\u0000';
        int numInsert = 10;
       
        Transaction tx = pm.currentTransaction();
        try {
            tx.begin();
            for (int i = 1; i <= numInsert; i++ ) {
                if (i%2 == 1) {
                    bFlag = true;
                    strValue = "Odd" + i;
                    charValue = 'O';
View Full Code Here

     */
    protected void compile(String assertion,
            Query query, String queryText, boolean positive) {
        PersistenceManager pm = getPM();
        Transaction tx = pm.currentTransaction();
        tx.begin();
        try {
            query.compile();
            if (!positive) {
                fail(assertion,
                        "Query compilation must throw JDOUserException: " +
View Full Code Here

            String singleStringQuery, boolean hasOrdering,
            Object parameters, Object expectedResult, boolean positive) {
        Object result = null;
        PersistenceManager pm = getPM();
        Transaction tx = pm.currentTransaction();
        tx.begin();
        try {
            try {
                if (parameters == null) {
                    result = query.execute();
                } else if (parameters instanceof Object[]) {
View Full Code Here

            String singleStringQuery, Object parameters,
            long expectedNrOfDeletedObjects) {
        boolean positive = expectedNrOfDeletedObjects >= 0;
        PersistenceManager pm = getPM();
        Transaction tx = pm.currentTransaction();
        tx.begin();
        try {
            try {
                long nr;
                if (parameters == null) {
                    nr = query.deletePersistentAll();
View Full Code Here

        Query query;
        Collection expected;
        Object result;
           
        Transaction tx = pm.currentTransaction();
        tx.begin();
        Department dept1 = reader.getDepartment("dept1");
        expected = new HashSet();
        expected.add(reader.getFullTimeEmployee("emp1"));
        expected.add(reader.getFullTimeEmployee("emp2"));
        expected.add(reader.getPartTimeEmployee("emp3"));
View Full Code Here

    /** */
    private void runTestRetrieve(PersistenceManager pm) {
        createObjects(pm);
        Transaction tx = pm.currentTransaction();
        try {
            tx.begin();
            pm.retrieve(p1);
            pm.retrieve(p3);
            pm.retrieve(rect);
            pm.makeTransient(p1);
            pm.makeTransient(p3);
View Full Code Here

    /** */
    private void runTestRetrieveAllWithCollection(PersistenceManager pm) {
        createObjects(pm);
        Transaction tx = pm.currentTransaction();
        try {
            tx.begin();
            Collection coll = new ArrayList();
            coll.add(p1);
            coll.add(p3);
            coll.add(rect);
            pm.retrieveAll(coll);
View Full Code Here

    /** */
    private void runTestRetrieveAllWithCollectionDFGtrue(PersistenceManager pm) {
        createObjects(pm);
        Transaction tx = pm.currentTransaction();
        try {
            tx.begin();
            Collection coll = new ArrayList();
            coll.add(p1);
            coll.add(p3);
            coll.add(rect);
            pm.retrieveAll(coll, true);
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.