Re: Simulating 2 phase commit
From: Diana Tracy <bs794_at_cleveland.Freenet.Edu>
Date: 27 Jan 1994 16:19:33 GMT
Message-ID: <2i8pil$df9_at_usenet.INS.CWRU.Edu>
Date: 27 Jan 1994 16:19:33 GMT
Message-ID: <2i8pil$df9_at_usenet.INS.CWRU.Edu>
Oracle 7 has a package included with it that you can use to simulate a 2 phase commit. It is called dbms_pipe. One session can communicate with another using pipes very similar to Unix pipes. The following pseudo-code will duplicate yours.
begin update TABLE_x set attr2 = "data" where attr1 = 5; dbms_pipe.pack_message('data'); dbms_pipe.send_message('pipe_name'); dbms_pipe.receive_message('pipe_name', answer); if answer = 'COMMIT' then commit; else rollback; end if; end;
Look up the package for detailed instrunctions in the Applications Developer's Guide. Pipes are cool, I just used them for the first time myself.
-- Diana Tracy, System Designer -- Excitement, Adventure bs794_at_cleveland.Freenet.Edu -- and Really Wild ThingsReceived on Thu Jan 27 1994 - 17:19:33 CET