NuoDb.Data.Client.EncodedDataStream.getLong C# (CSharp) Method

getLong() public method

public getLong ( ) : long
return long
        public virtual long getLong()
        {
            decode();

            if (type == edsTypeInt32)
            {
                return integer32;
            }

            if (type == edsTypeInt64)
            {
                return integer64;
            }

            throw new NuoDbSqlException("On message type " + currentMessageType + ":NuoDB jdbc expected int64 got type: " + type);
        }

Usage Example

Esempio n. 1
0
        private void updateLastCommitInfo(EncodedDataStream dataStream, bool generatingKeys)
        {
            generatedKeys = null;

            // From v2 - v6, gen keys were sent before last commit info
            if (connection.InternalConnection.protocolVersion >= Protocol.PROTOCOL_VERSION2 && connection.InternalConnection.protocolVersion < Protocol.PROTOCOL_VERSION7 && generatingKeys)
            {
                generatedKeys = createResultSet(dataStream, true);
            }

            // from v3 -v6, last commit info was not being sent if there was a gen key result set
            if ((connection.InternalConnection.protocolVersion >= Protocol.PROTOCOL_VERSION3 && !generatingKeys) || connection.InternalConnection.protocolVersion >= Protocol.PROTOCOL_VERSION7)
            {
                long transactionId = dataStream.getLong();
                int nodeId = dataStream.getInt();
                long commitSequence = dataStream.getLong();
                connection.InternalConnection.setLastTransaction(transactionId, nodeId, commitSequence);
            }

            // from v7 gen key result set is sent after last commit info (if at all)
            if (connection.InternalConnection.protocolVersion >= Protocol.PROTOCOL_VERSION7 && generatingKeys)
            {
                generatedKeys = createResultSet(dataStream, true);
            }
        }