Package org.apache.ojb.otm.core

Examples of org.apache.ojb.otm.core.Transaction.commit()


            tx.begin();

            conn.makePersistent(product);

            tx.commit();
        }
        catch (LockingException ex)
        {
            if (tx.isInProgress())
            {
View Full Code Here


            tx.begin();

            conn.deletePersistent(product);

            tx.commit();
        }
        catch (LockingException ex)
        {
            if (tx.isInProgress())
            {
View Full Code Here

            tx.begin();

            Iterator results = conn.getIteratorByQuery(query);

            tx.commit();

            return results;
        }
        finally
        {
View Full Code Here

            tx.begin();

            Iterator results = conn.getIteratorByQuery(query, lock);

            tx.commit();

            return results;
        }
        finally
        {
View Full Code Here

            tx.begin();

            Iterator results = conn.getIteratorByOQLQuery(oql);

            tx.commit();

            return results;
        }
        catch (QueryInvalidException ex)
        {
View Full Code Here

            Iterator results = conn.getIteratorByQuery(query, lock);

            if (auto)
            {
                tx.commit();
            }

            return results;
        }
        finally
View Full Code Here

                Product widget = (Product)wonderWidgets.next();

                widget.setName("Improved Wonder Widget");
            }

            tx.commit();
        }
        finally
        {
            conn.close();
        }
View Full Code Here

            example.setProductGroupId(7);
            example.setStock(333);
            example.setArticleName("333");
            _conn.makePersistent(example);

            tx.commit();

            Identity oid = _conn.getIdentity(example);

            // get from the cache
            tx = _kit.getTransaction(_conn);
View Full Code Here

            tx.begin();
            example = (Article) _conn.getObjectByIdentity(oid);
            assertEquals("should be equal", 7, example.getProductGroupId());
            assertEquals("should be equal", 333, example.getStock());
            assertEquals("should be equal", "333", example.getArticleName());
            tx.commit();

            // get from the database
            tx = _kit.getTransaction(_conn);
            tx.begin();
            _conn.invalidate(oid);
View Full Code Here

            _conn.invalidate(oid);
            example = (Article) _conn.getObjectByIdentity(oid);
            assertEquals("should be equal", 7, example.getProductGroupId());
            assertEquals("should be equal", "333", example.getArticleName());
            example.setArticleName("334"); // test update
            tx.commit();

            // get from the database via Query
            tx = _kit.getTransaction(_conn);
            _conn.invalidate(oid);
            tx.begin();
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.