Package org.apache.ojb.broker

Examples of org.apache.ojb.broker.PersistenceBroker.commitTransaction()


            // 4. start broker transaction
            broker.beginTransaction();
            // 5. delete product
            broker.deleteByQuery(query);
            // 6. commit transaction
            broker.commitTransaction();
        }
        catch (OJBRuntimeException ex)
        {
            // rollback in case of errors
            if (broker != null)
View Full Code Here


        {
            broker = PersistenceBrokerFactory.defaultPersistenceBroker();

            broker.beginTransaction();
            broker.store(product);
            broker.commitTransaction();
        }
        catch (PersistenceBrokerException ex)
        {
            if (broker != null)
            {
View Full Code Here

            broker.beginTransaction();
            for (int idx = 0; idx < products.length; idx++)
            {
                broker.store(products[idx]);
            }
            broker.commitTransaction();
        }
        catch (PersistenceBrokerException ex)
        {
            if (broker != null)
            {
View Full Code Here

                broker.store(result);
                // alternative, more performant:
                // broker.store(result, ObjectModificationDefaultImpl.UPDATE);

                broker.commitTransaction();
                isSold = true;
            }
        }
        catch (PersistenceBrokerException ex)
        {
View Full Code Here

            if (result != null)
            {
                broker.beginTransaction();
                broker.delete(result);
                broker.commitTransaction();
                isDeleted = true;
            }
        }
        catch (PersistenceBrokerException ex)
        {
View Full Code Here

        {
            broker = PersistenceBrokerFactory.defaultPersistenceBroker();

            broker.beginTransaction();
            broker.delete(product);
            broker.commitTransaction();
        }
        catch (PersistenceBrokerException ex)
        {
            if (broker != null)
            {
View Full Code Here

                    broker.beginTransaction();
                    broker.store(obj);
                    broker.store(p1);
                    broker.store(p2);
                    broker.commitTransaction();
                    // delete target object
                    broker.beginTransaction();
                    broker.delete(obj);
                    //broker.delete(p1);
                    //broker.delete(p2);
View Full Code Here

                    // delete target object
                    broker.beginTransaction();
                    broker.delete(obj);
                    //broker.delete(p1);
                    //broker.delete(p2);
                    broker.commitTransaction();
                }
                finally
                {
                    if (broker != null) broker.close();
                }
View Full Code Here

                        broker.getCollectionByQuery(query);
                        // store target object
                        Object obj = ClassHelper.newInstance(targetTestClass);
                        broker.beginTransaction();
                        broker.store(obj);
                        broker.commitTransaction();
                        // delete target object
                        broker.beginTransaction();
                        broker.delete(obj);
                        broker.commitTransaction();
                    }
View Full Code Here

                        broker.store(obj);
                        broker.commitTransaction();
                        // delete target object
                        broker.beginTransaction();
                        broker.delete(obj);
                        broker.commitTransaction();
                    }
                    finally
                    {
                        if (broker != null) broker.close();
                    }
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.