BaanIV_Tools
24th July 2014, 10:55
Hi All,

I want to know about the function set.transaction.readonly().
Anyone used this function earlier? can you help me with an example?

Thanks,
Learner

bhushanchanda
24th July 2014, 11:28
Hi,

I guess everything is clearly mentioned in Prog Guide:-

Syntax:
function long set.transaction.readonly ()

Description

This defines a transaction as read only. The transaction can only read records (without locks) from the database; it cannot update the database.

When included, this function must be the first command of a transaction. So, you must include it either at the start of the program or immediately following a commit.transaction() or abort.transaction() call.

Because it is not possible to update the database in a read-only transaction, you can use only the following database calls in the transaction:

db.first() db.lt()

db.last() db.le()

db.next() db.set.to.default()

db.prev() db.change.order()

db.gt() db.indexinfo()

db.ge() db.nr.indices()

db.eq() db.nr.rows()

db.cur() db.row.length()

db.bind() db.record.to.columns()

db.unbind() db.columns.to.record()

db.error()


Also go through this Thread (http://www.baanboard.com/node/45) to get more knowledge.