I'm unfamiliar with the concept of snapshot advancement. 

Modifying the -upd-crt 0 produced the result I was expecting.  

I have never run into this read-only behavior working with RDBMS.  I spoke
to several people that thought the SEDNA read-only behavior as odd.

My biggest recommendation to developers using SENDA is to avoid read-only
and use transactional basis only.

Thanks for the help,
Malcolm

-----Original Message-----
From: Ivan Shcheklein [mailto:[email protected]] 
Sent: Wednesday, September 05, 2012 3:32 AM
To: Malcolm Davis
Cc: [email protected]; [email protected]
Subject: Re: [Sedna-discussion] Transaction versus Read-only

Hi Malcolm,

Probably, this is the way read-only transactions work. Read these
discussions and try to tune upd-crt parameter value:

-
http://www.mail-archive.com/[email protected]/msg00910.
html
- http://thread.gmane.org/gmane.text.xml.sedna/1166/focus=1169
-
http://www.mail-archive.com/[email protected]/msg01283.
html

See details on read-only sessions here:
- http://sedna.org/progguide/ProgGuidesu2.html#x5-130001.2.3
(SEDNA_ATTR_CONCURRENCY_TYPE)
- http://sedna.org/adminguide/AdminGuidesu3.html#x7-100002.3.1 (upd-crt
parameter)

Ivan Shcheklein,
Sedna Team

On Wed, Sep 5, 2012 at 7:57 AM, Malcolm Davis <[email protected]>
wrote:


        When using transaction and read-only with the system, the read-only
never
        seems to pickup transaction changes.
        
        I have tried different approaches to no avail.  The only thing that
seems to
        work is restarting the SEDNA instance.
        
        I don't know if the problem is a bug, or I am just missing
something.
        
        The following code demonstrates the behavior.
        
        MyCustomers.xml
            <?xml version="1.0" standalone="yes"?>
            <Customers>
            </Customers>
        
        
        package sednadb.test;
        
        import ru.ispras.sedna.driver.DatabaseManager;
        import ru.ispras.sedna.driver.DriverException;
        import ru.ispras.sedna.driver.SednaConnection;
        import ru.ispras.sedna.driver.SednaSerializedResult;
        import ru.ispras.sedna.driver.SednaStatement;
        
        
        public class SednaConnectionResponseTest {
        
            public static void main(final String[] args) {
                SednaConnectionResponseTest test = new
        SednaConnectionResponseTest();
                test.run();
            }
        
            private void run() {
                // Simple SEDNA request
                try {
                    SednaConnection queryConnection = getConnection(true);
                    runStatement(queryConnection,
"doc(\"MyCustomers.xml\")");
                    queryConnection.close();
        
                    SednaConnection insertConnection = getConnection(false);
                    runStatement(insertConnection, "update insert
        <customer><id>5</id><name>Carpet
cleaner</name><state>GA</state></customer>
        into doc(\"MyCustomers.xml\")/Customers");
                    insertConnection.close();
        
                    // NOTE: New connection, but does not see the newly
inserted
        data.
                    // The test can be executed over and over, and the
inserted
        lines will never appear
                    SednaConnection queryConnection2 = getConnection(true);
                    runStatement(queryConnection2,
"doc(\"MyCustomers.xml\")");
                    queryConnection2.close();
        
                } catch (DriverException e) {
                     System.out.println(e.toString());
                     System.out.println(e.getDebugInfo());
                }
        
            }
        
            protected void runStatement(final SednaConnection connection,
final
        String statement)
                    throws DriverException {
        
        
System.out.println("-----------------------------------------------");
                System.out.println(statement);
                connection.begin();
                SednaStatement st1 = connection.createStatement();
                StringBuffer sb = new StringBuffer();
                boolean call_res = st1.execute(statement);
                if (call_res) {
                    SednaSerializedResult pResult =
st1.getSerializedResult();
                    if (pResult != null) {
                        String item;
                        while ((item = pResult.next()) != null) {
                            sb.append(item);
                        }
                    } else {
                        System.out.println("statement.getSerializedResult()
is
        null");
                    }
                }
                connection.commit();
                System.out.println(sb.toString());
            }
        
        
            protected SednaConnection getConnection(final boolean readonly)
throws
        DriverException {
                SednaConnection con =
DatabaseManager.getConnection("localhost",
        "mydata", "SYSTEM", "MANAGER");
                con.setTraceOutput(true);
                con.setDebugMode(true);
                con.setReadonlyMode(readonly);
                return con;
            }
        }
        
        
        Thanks,
        Malcolm
        
        
        
----------------------------------------------------------------------------
--
        Live Security Virtual Conference
        Exclusive live event will cover all the ways today's security and
        threat landscape has changed and how IT managers can respond.
Discussions
        will include endpoint security, mobile security and the latest in
malware
        threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
        _______________________________________________
        Sedna-discussion mailing list
        [email protected]
        https://lists.sourceforge.net/lists/listinfo/sedna-discussion
        




------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Sedna-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sedna-discussion

Reply via email to