Java CAPS 6, JCA, Note 6, JMS-Triggered JCA with Oracle and Batch Local File - Exploration of transactionality

Rather then inventing an example to discuss and illustrate the use of the Oracle JCA Adapter let’s build a solutions that uses the Oracle JCA Adapter and shows additional Java CAPS 6 facilities of interest.


Let’s take the example from the "Java CAPS Basics: Implementing Common EAI Patterns Companion CD" book, ISBN: 0-13-713071-6, Chapter 11 "Scalability and Resilience", Section 11.2 "Exception Handling", subsection 11.2.1 "Exceptions in Java Collaborations", 11.2.1.1 "JMS-Triggered Java Collaborations". The book from which this section comes is available on the Companion CD. Let’s re-work this example using Java CAPS 6 JCA Adapters.


This example illustrates exception handling involving a JMS-triggered JCA Message-Driven Bean.
The MDB is designed to receive a JMS message, update a field in a database table row with the value of the text message, write the text message, together with the timestamp, to a file and finish.


The complete Note is provided in 06JMSTriggeredJCAwithOracle.pdf


Update: Thanks to Dao Tien Tran for pointing out a typo on page 5. I corrected the typo and uploaded the corrected document.  Change is marked in color and with a change bar.




Comments:

Having worked with JCAPS5.1.3 for the past 6 months or so, we are in the process of moving to JCAPS6. Your tutorials are the best resource I have found for getting a feel for working with CAPS6. But I'm still having problems. I am trying to create a prototype application to read a DB table and print the results to a file. Following this note I discovered that in order to get the wizard you show in Sec 6 (pg 7) I had to install the Oracle adaptor, and the Oracle OTD wizard modules from the Adapter pack. But when I get to the part on page 15, where I drag the Oracle JCA icon to the receive method, and select the otd that I created (under Source Packages it shows up as otds.oracle/otdTpaConfig.otd) I get a new parameter of type otdTpaConfig.OtdTpaConfigOTD. As you mentioned the variable is named with OTD appended to the name I specified. However, I am getting a compile error that 'package otdTpaConfig does not exist'. I was also getting the same error on package com.stc.util until I added the OTD library to the 'Libraries' branch.

I can't figure out what I am missing so that the otdTpaConfig package is visible. Any ideas?

Posted by Dave Derry on September 08, 2008 at 05:58 PM EST #

Well I managed to solve that problem, but it seems like an unnecessary step to me. Inspection of my file system turned up lib\\otds\\oracle\\otdTpaConfig.jar under the project folder for this project. Back in Netbeans I right clicked on the 'Libraries' element and added this jar. The problem went away. But since this jar was generated because I defined the OTD in the project I would expect it to automatically be included.

Posted by Dave Derry on September 08, 2008 at 08:18 PM EST #

Thanks a lot Michael for all the information that you have provided regarding JCAPS 6 via your blogs.

We are just trying out some Proof Of Concepts using JCAPS 6.0 and all the material you have posted are very useful.

I have used the JDBC Otd wizard instead of the Oracle and have managed to create the OTD from the Netbeans EJB Module.

However there do not be any provisions for modifying the otd e.g:- adding a new prepared statement, or none that i can see. I tried right-clicking on the otd and selected Edit but that only brings up the XML editor and not any wizard.

Can you please let me know if there is any way to achieve this in the new JCAPS 6.0 non-repository based projects?

Cheers,
Suchitra

Posted by Suchitra on November 04, 2008 at 06:36 AM EST #

Hello, Suchitra.

I am glad my blogs proved useful. Thank you for the good word.
I am not sure I follow the description of what you did. Could you, please, email me the project to which you are referring? My eMail address is Michael DOT Czapski AT sun DOT com

Regards

Michael

Posted by Michael Czapski on November 04, 2008 at 06:48 AM EST #

Hey Michael,
While looking for some literature on Oracle OTD wizard, I found this post. The problem I am looking solution for is editing a OTD which was created using Oracle OTD Wizard. In Repository based approach, we can refresh (edit) an oracle OTD to reflect the changes in the corresponding DB tables. I am not seeing similar option in OTDs created using OTD wizard.
Let me if it is the limitation of wizard.

Thanks
Manish

Posted by Manish Jain on February 20, 2009 at 04:47 PM EST #

Hello, Manish.

The method described in the Note is not supported in Java CAPS 6. Please use the method wherein you create an Oracle OTD in the Repository-based project then use the OTDImporter to import it import it for use in your project. When importing you will be given an opportunity to specify whether to refresh on build, refresh on clean or refresh on create. Choosing the correct option, for example refresh on clean, will give you the ability to modify the OTD in the repository-based project then do a "clean" on your EJB Project and have the changes incorporated. As a side-effect you will have a supported method of doing this. The Note is fairly old. I may not be able to update it.

Regards

Michael

Posted by Michael Czapski on February 25, 2009 at 01:06 PM EST #

Where do we find the OTDImporter in Netbeans. I can find a placeholder for the docs http://developers.sun.com/docs/javacaps/designing/dotddbadptr.dsgn_otd-importer_t.html but no real documentation. I found "About CAPS OTD Importer" in the Netbeans Help - but it doesn't tell me where or how to launch the importer. I found the "Constructs OTD object" in the OTD Palette which tells me to "Please import OTD," but nothing tells me HOW to import the OTD.

Thanks,
Bill

Posted by Bill on April 25, 2009 at 07:33 PM EST #

Found it:

File->New File->CAPS->OTD Importer

Posted by Bill on April 25, 2009 at 07:53 PM EST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

In this Blog I post abstracts of articles / writeups / notes on various aspects of Java CAPS and SOA Suite including solutions, discussions and screencasts. The links to the referenced material are included in the bodies of the abstracts.

Search

Categories
Archives
« July 2014
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