Processing an input message in a JMP application
A transaction begins when the application receives an input message and ends when the application commits the results from processing the message. To get an input message, the application calls the MessageQueue.getUnique method.
Processing an input message sample code
The following code example shows how an input message is processed in a JMP application.
import com.ibm.ims.dli.tm.*;
public static void main(String args[]) {
conn = dataSource.getConnection(...); //Establish DB connection
while(messageQueue.getUnique(...)){ //Get input message, which
//starts transaction
results=statement.executeQuery(...); //Perform DB processing
...
messageQueue.insert(...); //Send output messages
...
}
conn.close(); //Close DB connection
return;
}