Package nexj.core.runtime

Examples of nexj.core.runtime.InvocationContext.beginTransaction()


            List sendList = null;

         loop:
            for (;;)
            {
               context.beginTransaction();
               context.getUnitOfWork().setRaw(true);

               long lCurrentTime = System.currentTimeMillis();
               InstanceList list = Query.createRead(timerClass, attributes,
                  (m_bDistributed) ? Pair.attribute("next").le(new Timestamp(lCurrentTime + m_lInterval)) : null,
View Full Code Here


               {
                  nTimeout = number.intValue();
               }
            }

            machine.returnValue(context.beginTransaction(true, nTimeout), nArgCount);

            return false;
         }

         public Symbol getSymbol()
View Full Code Here

        
         assertTrue(fragment1File.exists());
         assertEquals("Creation (\u4e2d\u6587) data.", readFileToString(fragment1File));
        
         // Update it
         assertNull(context.beginTransaction());
        
         a.setValue("data", new Binary("Modified data.\nModified.".getBytes("utf-8")));
        
         // Replication
         context.getUnitOfWork().addReplicationFragment(a, "fragment1");
View Full Code Here

         assertEquals("Modified data.\nModified.", readFileToString(defaultFile));
         assertTrue(fragment1File.exists());
         assertEquals("Modified data.\nModified.", readFileToString(fragment1File));
        
         // Delete it
         assertNull(context.beginTransaction());
        
         a.invoke("delete");
        
         // Replication
         context.getUnitOfWork().addReplicationFragment(a, "fragment1");
View Full Code Here

            tempDir.getAbsolutePath(),
            jrnlDir.getAbsolutePath());
        
        
         // Create it
         assertNull(context.beginTransaction());
        
         Metaclass testFPA = metadata.getMetaclass("TestFPA");
         Instance a = (Instance)testFPA.invoke("new");
        
         a.setValue("data", new Binary("Creation data.".getBytes("utf-8")));
View Full Code Here

       
         OID oidA = a.getOID();
         String sOidName = (String)oidA.getValue(0);
        
         // Read
         assertNull(context.beginTransaction());
         a.invoke("read", new Object[]{
            parse("(data)"),
            parse("(= (@ id) \"" + sOidName + "\")"), null, null, null, null
         });
         assertEquals(new Binary("Creation data.".getBytes("utf-8")), a.getValue("data"));
View Full Code Here

         a.setValue("data", new Binary("Update data.".getBytes("utf-8")));
        
         commit(context);
        
         // Read
         assertNull(context.beginTransaction());
         a.invoke("read", new Object[]{
            parse("(data)"),
            parse("(= (@ id) \"" + sOidName + "\")"), null, null, null, null
         });
         assertEquals(new Binary("Update data.".getBytes("utf-8")), a.getValue("data"));
View Full Code Here

         a.invoke("delete");
        
         commit(context);
        
         // Read (NOT FOUND)
         assertNull(context.beginTransaction());
           
         Query query = Query.createRead(testFPA, null, parse("(= (@ id) \"" + sOidName + "\")"), null, 10, 0, false, Query.SEC_NONE, context);
         InstanceList resultList = query.read();
           
         assertEquals(0, resultList.getCount());
View Full Code Here

         assertEquals(0, resultList.getCount());
        
         commit(context);

         // Create it (test that the read operation doesn't add the not-found instance to the invocation context)
         assertNull(context.beginTransaction());

         a = (Instance)testFPA.invoke("new");
         a.setOID(oidA);
         a.setValue("data", new Binary("Creation data #2.".getBytes("utf-8")));
View Full Code Here

            tempDir.getAbsolutePath(),
            jrnlDir.getAbsolutePath());
        
        
         // Create it
         assertNull(context.beginTransaction());
        
         Metaclass testFPA = metadata.getMetaclass("TestFPA");
         Instance a = (Instance)testFPA.invoke("new");
        
         a.setValue("data", new Binary("Creation data for 'a'.".getBytes("utf-8")));
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.