Transacted and Non Transacted Sessions - Oracle AQJMS

Oracle AQJMS Transacted & Not Transacted Session Example. A session provides a transactional context with which to group a set of sends and receives into an atomic unit of work. 1. Remove Non Transacted statement shown below in JMSClient1 and JMSClient2 classes from Example1 QueueSession m_queueSess = qc.createQueueSession(false, Session.AUTO_ACKNOWLEDGE) 2. Add Transacted statement shown below in JMSClient1 and JMSClient2 classes in the Example1 QueueSession m_queueSess = qc.createQueueSession(true, 0); 3. Create MultipleText Messages in JMSClient1 Message mesg1 = m_queueSess.createTextMessage("Test1 Message"); Message mesg2 = m_queueSess.createTextMessage("Test2 Message"); 4. send Above messages to Q. m_sender.send(mesg1); m_sender.send(mesg2); 5. The Above Messages gets Queued only if you call Session Commit statement after sending message to Q else Messages are rollback. m_queueSess.Commit(); 6. Receive Above messages from Q in JMSClient2. m_sender.receive(mesg); m_sender.receive(mesg); 5. The Above Messages removed from Queue only if you call Session Commit statement after receiving message from Q else Messages are remain in Q after maximum retry is reached. m_queueSess.Commit();
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

bocadmin_ww

Search

Archives
« March 2015
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
    
       
Today