Package org.apache.ojb.odmg

Examples of org.apache.ojb.odmg.TransactionImpl$CascadeSettingException


        {
            this.size++;
            DSetEntry entry = new DSetEntry(this, o);
            elements.add(entry);
            // if we are in a transaction: get locks !
            TransactionImpl tx = getTransaction();
            if ((tx != null) && (tx.isOpen()))
            {
                tx.lock(this, Transaction.WRITE);
                tx.lock(entry, Transaction.WRITE);
                tx.lock(o, Transaction.READ);
            }
            return true;
        }
        else
        {
View Full Code Here


    {
        DListEntry_2 entry = prepareEntry(element);
        elements.add(index, entry);
        this.size++;
        // if we are in a transaction: acquire locks !
        TransactionImpl tx = TxManagerFactory.instance().getTransaction();
        if (checkForOpenTransaction(tx))
        {
            tx.lock(this, Transaction.WRITE);
            tx.lock(entry, Transaction.WRITE);
            tx.lock(element, Transaction.READ);
            entry.prepareForPersistency(tx.getBroker());
        }

        // changing the position markers of entries:
        int offset = 0;
        try
View Full Code Here

     */
    public Object remove(int index)
    {
        DListEntry_2 entry = (DListEntry_2) elements.get(index);
        // if we are in a transaction: acquire locks !
        TransactionImpl tx = TxManagerFactory.instance().getTransaction();
        if (checkForOpenTransaction(tx))
        {
            tx.markDelete(entry);
        }
        this.size--;
        elements.remove(index);
        // changing the position markers of entries:
        int offset = 0;
View Full Code Here

    public Object execute() throws org.odmg.QueryException
    {
        if (log.isDebugEnabled()) log.debug("Start execute query");

        //obtain current ODMG transaction
        TransactionImpl tx = odmg.getTxManager().getTransaction();
        // create PBCapsule
        PBCapsule capsule = null;
        ManageableCollection result = null;

        try
View Full Code Here

     * @see java.util.ListIterator#remove()
     */
    public void remove()
    {
        iter.remove();
        TransactionImpl tx = dlist.getTransaction();
        if (tx != null)
        {
            tx.markDelete(currentEntry);
        }
        currentEntry = null;
    }
View Full Code Here

    public PBKey getPBKey()
    {
        if(pbKey == null)
        {
            TransactionImpl tx = getTransaction();
            if(tx != null && tx.isOpen())
            {
                pbKey = tx.getBroker().getPBKey();
            }
        }
        return pbKey;
    }
View Full Code Here

        if (!this.contains(o))
        {
            DSetEntry entry = prepareEntry(o);
            elements.add(entry);
            // if we are in a transaction: get locks !
            TransactionImpl tx = getTransaction();
            if ((tx != null) && (tx.isOpen()))
            {
                RuntimeObject rt = new RuntimeObject(this, tx);
                tx.lockAndRegister(rt, Transaction.WRITE, false);

                tx.lock(o, Transaction.READ);

                rt = new RuntimeObject(entry, tx, true);
                tx.lockAndRegister(rt, Transaction.WRITE, false);
            }
            return true;
        }
        else
        {
View Full Code Here

     */
    public DCollection query(String predicate) throws org.odmg.QueryInvalidException
    {
        // 1.build complete OQL statement
        String oql = "select all from java.lang.Object where " + predicate;
        TransactionImpl tx = getTransaction();

        OQLQuery predicateQuery = tx.getImplementation().newOQLQuery();

        PBCapsule capsule = new PBCapsule(tx.getImplementation().getCurrentPBKey(), tx);
        PersistenceBroker broker = capsule.getBroker();

        try
        {
            predicateQuery.create(oql);
View Full Code Here

    public PBKey getPBKey()
    {
        if(pbKey == null)
        {
            TransactionImpl tx = getTransaction();
            if(tx != null && tx.isOpen())
            {
                pbKey = tx.getBroker().getPBKey();
            }
        }
        return pbKey;
    }
View Full Code Here

    public PBKey getPBKey()
    {
        if(pbKey == null)
        {
            TransactionImpl tx = getTransaction();
            if(tx != null && tx.isOpen())
            {
                pbKey = tx.getBroker().getPBKey();
            }
        }
        return pbKey;
    }
View Full Code Here

TOP

Related Classes of org.apache.ojb.odmg.TransactionImpl$CascadeSettingException

Copyright © 2018 www.massapicom. 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.