[sqlite] Programmatic notification of BEGIN TRANSACTION?

2006-04-04 Thread Mike Ashmore

Hi,
I have some triggers that fire on INSERT, UPDATE, and DELETE to a  
view. Those triggers calls a user-defined library function. What I  
was wondering was, is there some way my library function can be  
notified of the beginning and end of a transaction?


For instance, if the user issues an UPDATE on the view that affects  
four records, my UPDATE trigger fires four times. What I'd like to  
know is when that outer UPDATE transaction begins and ends, so that I  
can then group my user-defined function's actions in a way that  
continues to guarantee transactional atomicity.


Is this possible short of mucking around in the VDBE? And if VDBE- 
mucking is required, does anybody want to offer any pointers?


Thanks,
-Mike Ashmore


Re: [sqlite] Programmatic notification of BEGIN TRANSACTION?

2006-04-04 Thread drh
Mike Ashmore [EMAIL PROTECTED] wrote:
 Hi,
 I have some triggers that fire on INSERT, UPDATE, and DELETE to a  
 view. Those triggers calls a user-defined library function. What I  
 was wondering was, is there some way my library function can be  
 notified of the beginning and end of a transaction?
 
 For instance, if the user issues an UPDATE on the view that affects  
 four records, my UPDATE trigger fires four times. What I'd like to  
 know is when that outer UPDATE transaction begins and ends, so that I  
 can then group my user-defined function's actions in a way that  
 continues to guarantee transactional atomicity.
 
 Is this possible short of mucking around in the VDBE? And if VDBE- 
 mucking is required, does anybody want to offer any pointers?
 

http://www.sqlite.org/capi3ref.html#sqlite3_commit_hook
--
D. Richard Hipp   [EMAIL PROTECTED]