Package org.apache.ojb.odmg.shared

Examples of org.apache.ojb.odmg.shared.Article


    public void testLockBasics() throws Exception
    {
        TransactionImpl tx1 = (TransactionImpl) odmg1.newTransaction();
        TransactionImpl tx2 = (TransactionImpl) odmg2.newTransaction();

        Article a = new Article();
        a.setArticleId(333);

        tx1.begin();
        tx2.begin();
        LockManager lm = LockManagerFactory.getLockManager();
        boolean success1 = lm.writeLock(tx1, a);
View Full Code Here


    public void testLockBasics2() throws Exception
    {
        TransactionImpl tx1 = (TransactionImpl) odmg1.newTransaction();
        TransactionImpl tx2 = (TransactionImpl) odmg2.newTransaction();

        Article a1 = new Article();
        a1.setArticleId(333);

        Article a2 = new Article();
        a2.setArticleId(333);

        tx1.begin();
        tx2.begin();
        LockManager lm = LockManagerFactory.getLockManager();
View Full Code Here

     *
     * @return the created PerformanceArticle object
     */
    private Article createArticle(String name)
    {
        Article a = new Article();

        a.setArticleName(PRE + name);
        a.setMinimumStock(100);
        a.setOrderedUnits(17);
        a.setPrice(0.45);
        a.setProductGroupId(1);
        a.setStock(234);
        a.setSupplierId(4);
        a.setUnit("bottle");
        return a;
    }
View Full Code Here

    {
        int loops = 10;
        Article[] arr = new Article[loops];
        for(int i = 0; i < loops; i++)
        {
            Article a = createArticle("testLockLoop");
            arr[i] = a;
        }

        TransactionImpl tx = (TransactionImpl) odmg1.newTransaction();
        tx.begin();
View Full Code Here

    public void testLockBasics() throws Exception
    {
        TransactionImpl tx1 = (TransactionImpl) odmg1.newTransaction();
        TransactionImpl tx2 = (TransactionImpl) odmg2.newTransaction();

        Article a = new Article();
        a.setArticleId(333);

        tx1.begin();
        tx2.begin();
        LockManager lm = LockManagerFactory.getLockManager();
        boolean success1 = lm.writeLock(tx1, a);
View Full Code Here

    public void testLockBasics2() throws Exception
    {
        TransactionImpl tx1 = (TransactionImpl) odmg1.newTransaction();
        TransactionImpl tx2 = (TransactionImpl) odmg2.newTransaction();

        Article a1 = new Article();
        a1.setArticleId(333);

        Article a2 = new Article();
        a2.setArticleId(333);

        tx1.begin();
        tx2.begin();
        LockManager lm = LockManagerFactory.getLockManager();
View Full Code Here

     * factory method that createa an PerformanceArticle
     * @return the created PerformanceArticle object
     */
    private Article createArticle(String name)
    {
        Article a = new Article();

        a.setArticleName(PRE + name);
        a.setMinimumStock(100);
        a.setOrderedUnits(17);
        a.setPrice(0.45);
        a.setProductGroupId(1);
        a.setStock(234);
        a.setSupplierId(4);
        a.setUnit("bottle");
        return a;
    }
View Full Code Here

    {
        int loops = 10;
        Article[] arr = new Article[loops];
        for (int i = 0; i < loops; i++)
        {
            Article a = createArticle("testLockLoop");
            arr[i] = a;
        }

        TransactionImpl tx = (TransactionImpl) odmg1.newTransaction();
        tx.begin();
View Full Code Here

        tx.commit();
    }

    private Article createArticle()
    {
        Article example = new Article();
        example.setArticleName(testProductGroup.getName());
        example.setProductGroupId(testProductGroup.getId());
        return example;
    }
View Full Code Here

    {
        String bindingName = "testBind_" + System.currentTimeMillis();
        TransactionImpl tx = (TransactionImpl) odmg.newTransaction();
        //bind object to name
        tx.begin();
        Article example = createArticle();
        database.makePersistent(example);
        tx.commit();

        tx.begin();
        try
        {
            database.bind(example, bindingName);
            Article value = (Article) database.lookup(bindingName);
            assertTrue("Could not lookup object for binding name: "+bindingName, value != null);
            tx.commit();
        }
        catch (ObjectNameNotFoundException ex)
        {
View Full Code Here

TOP

Related Classes of org.apache.ojb.odmg.shared.Article

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.