Creating Threads in a JCA 1.0 Adapter

     When creating a Resource Adapter based on the JCA 1.0 specification is there any reason why the adapter could not create one or more threads to support its communication with an Enterprise Information System? This adapter would be used in a managed EJB container, which of course does not allow you to create new threads. I know that the JCA 1.5 specification provides work management API�s to off load this responsibility to the server, however this is not an option.
- Scott

That shouldn't be too bad, as long as you want the threads to die when the connection is lost ( which you will know about ) or when the app server is stopped ( as the appserver/operating system will take care of them and any resources they have, although if your threads need to do specific processing on shutdown you may have a problem*). If you wanted it to be when your application was stopped as opposed to the server, that would be a different thing, as JCA resources are effectively separate from your J2EE application, and not tied to its lifecycles. If this is the case then let me know.
Another issue may not apply to you - I'm assuming that since they're socket based they won't be XA resources. If they were, they may be serialized and deserialized by your appserver in the transaction logs, in which case you would have to be careful about what items should be transient.
* you may not be informed by the application server that its shutting down.

Similar Messages

  • Cannot create Proxy service with JCA transport

    Hello everyone.
    I have some issues while trying to create ftp service with jca transport. I follow the instruction in this tutorial:
    http://blogs.oracle.com/MarkSmith/entry/osb_and_ftp_adapter_in_11g
    I stuck in Step 4, cannot create proxy service to use JCA file that I created by JDeveloper 11g (11.1.1.5). When I specify jca file for proxy service, a error message returned:
    <ALSB Console> <BEA-494002> <Internal error occured in OSBConsole : Transport exception occurred with the following message:
    Invalid JCA file for JCA proxy service. If you are creating a Proxy from a Business Service, please select a different transport type (for example, http). If not, JCA file must contain JCA activation spec properties.And these are my jca file content that created by JDeveloper:
    <adapter-config name="myJCA_FTP_service" adapter="FTP Adapter" wsdlLocation="myJCA_FTP_service.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
      <connection-factory location="eis/ftp/MyFtpAdapter"/>
      <endpoint-interaction portType="Put_ptt" operation="Put">
        <interaction-spec className="oracle.tip.adapter.ftp.outbound.FTPInteractionSpec">
          <property name="PhysicalDirectory" value="/home/FTP-shared/upload"/>
          <property name="FileType" value="ascii"/>
          <property name="Append" value="false"/>
          <property name="FileNamingConvention" value="osb_%SEQ%"/>
          <property name="NumberMessages" value="1"/>
        </interaction-spec>
      </endpoint-interaction>
    </adapter-config>Is there anyone who had tried to use JCA transport with Ftp adapter already? Please give me a suggestion.
    Any response is appreciated
    Regards, Cuong Pham

    To get to the basics.
    You use GET to read files from an FTP location - This can be done by an OSB proxy service only.
    You use PUT to write files to an FTP location - This can be done by an OSB business service only.
    So forget that you need a proxy service for PUT.

  • How to Create a Flat File using FTP/File Adapter

    Can any body done workaround on creating the Flat file using FTP/File Adapter?.
    I need to create a simple FlatFile either using of delimiter/Fixed length. using the above said adapters we can create XML file, i tried concatinating all the values into a single String and writing into a file, but it does not have proper structure
    Can any body help me out on this..
    Thanks
    Ram

    You can create a text schema while creating a File Adapter. If schema is specified for File Adapter, it takes care of converting XML into fixed length or delimited format.
    Thanks,
    -Ng.

  • FTP error-Unable to create new pooled resource: com.sap.aii.adapter.file.ft

    Hi,
    We have a scenario where XI receives a Idoc and based on the contents of Idoc, It will generate 5 different files and send it to the external FTP server.We configured 5 receiver channels for these 5 files.
    When this interface runs, most of the files will be delivered but some of the messages will be errored out.
    The receiver channel has shown the following error-
    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: com.sap.aii.adapter.file.ftp.FTPEx
    I tried to resend them by temperorily stopping other channels to reduce connections to this FTP server.But these messages again resulted with same error.
    Can someone suggest what might be the cause for this error.
    Thanks in advance.

    Hi ,
    As I am not sure about the problem so U just try all of the option I am writing below. It may help u as these are the probable solutions for this problem.
    1.perform Full CPA cache refresh using PIDIRUSER
    2.The problem seems to be in establishing the connection with the File server . This could be due to
    a. Wrong user name or password in receiver adapter .
    b. Firewall connection are not open
    actually you are saying that some files are being delivered so all the file has to be deliverd on same server on diffrent directory or all files are going on diffrent server at present I am assuming that all files are going on diffrent server so please check UID & PWD properly.if they are on same server but diff. directory it can be easily done using one Communication channel only.
    3. Finally please check the errorneous communication channel .
    to check your communication channels are working fine or not you can check in channel monitoring in PI7.0, adapter monitoring in Xi3.0.
    if you are on PI7.0, goto RWBCache monitoring select AE and cilck disply-select the date todays--check everything is greent here
    4.Please check your maximal connection pool .
    Regards,
    Saurabh

  • How to Create a Unix Agent and data stage adapter

    Hi Gurus,
    I am new to this tool. We have installed trail version of tidal scheduler tool. Kindly let me know how to create a unix agent and data stage adapter using some screen shots. Also please let me know is it possible to create agents on trail version
    Thanks,
    Saravanan Viswanathan                  

    edburns wrote:
    Can someone please tell me how to create a Unix Group on Leopard and how to add myself to that group?
    Ed
    man dseditgroupshould help. Look particularly at the examples.

  • Error Code -17400; Unable to create thread

    Running TestStand 4.0.  Test sequence calls many sequences that run as new executions and runs fine for up to about 8 units testing simultaneously.  After that, I get a run-time error code -17400; Unable to create thread.  There are no other details available.  The steps that generate the error are able to create the new executions initially, but eventually fail once about 22 executions are running.  I am monitoring memory resources and there does not appear to be any issues.  Any troubleshooting suggestions?  Thanks.

    My test sequence has several test groups, each of which contain loops that create new threads (tests) for 48 UUTs.  Thus the number of running threads does get very high.  I was running into problems with Windows XP GDI Object resources once the number of threads reached about 200.  I then modified my program into smaller test groups to keep the number of threads at any time to less than 150.  GDI resources are no longer an issue, but the error -17400 unable to create thread happens after the first test group has completed and the second test group is just trying to run.  Note that the second test group runs fine if I skip the first test group, so the sequence itself should be okay.  I thought it might be a memory issue (even though there are no apparent memory issues seen in Windows Task Manager), so I set the "Unload after step executes" property for each of the new executions created.  That did not resolve the issue. 
    I am trying to create a simple sequence to duplicate the error without using any of the actual test sequences that require test hardware, but have not been successful thus far.
    Thanks for your replies and suggestions!

  • Use a JCA 1.5 Adapter with BPEL

    We have a JCA 1.5 adapter working with OC4J 10.1.3. Has someone an example how to use a JCA 1.5 adapter with the WSIF JCA binding in BPEL ?

    Hi Manfred,
    If you download the Oracle BPEL Process Manager preview on OTN, it contains 4 tutorial directories
      121.FileAdapter
      122.DBAdapter
      123.JmsAdapter
      124.AQAdapter
    which demonstrates how to define a JCA interaction (or activation) using WSDL (based on WSIF).
    The JCA connection information is encapsulated in a J2C deployed connection factory, and referenced in the WSDL Service section, for example
    <service name="ReadFile">
      <port name="Read_pt" binding="tns:Read_binding">
        <jca:address adapterInstanceJndi="eis/FileAdapter"/>
    The JCA interaction properties are captured in the WSDL Binding Operation element, for example (inbound)
    <binding name="Read_binding" type="tns:Read_ptt">
      <pc:inbound_binding />
      <operation name="Read">
        <jca:operation ActivationSpec=
        "oracle.tip.adapter.file.inbound.FileActivationSpec"
           PhysicalDirectory="C:\tmp"
           IncludeFiles=".+\.xml"
    Outbound example:
    <binding name="Write_binding" type="tns:Write_ptt">
      <jca:binding />
      <operation name="Write">
        <jca:operation InteractionSpec=
        "oracle.tip.adapter.file.outbound.FileInteractionSpec"
           PhysicalDirectory="C:\out"
           FileNamingConvention="out_%TIME%.xml"
    You can also browse at the tutorial directories to discover some more example.
    Hope this helps.
    -Bo

  • Create Thread on Photoshop Plug-in

    Dear All,
    Right now, I am developing a demo Photoshop plug-in software to understand the way to implement Photoshop plug-in. However, I meet a issues that I can not create a Thread on Photoshop plug-in by CreateThread() API. I implement as below:
    Main function:
    CreateThread( NULL, 0, Test1Thread, NULL, 0, NULL);
    Thread function:
    DWORD WINAPI Test1Thread(LPVOID pParam)
    /*Do something*/
    return 0;
    When I compile and load plug-in on Photoshop, it show an error message like this:
    The instruction at "0x09fd100a" referenced memory at "0x09fd100a". The memory could not be "read"
    Click on OK to terminate the program
    Click on CANCEL to debug the program
    Can you give me some suggestions that I can create a Thread by CreateThread() API on Photoshop plug-in or not? And how can I create Thread?
    I am looking forward your answer.
    Thanks for your help,
    Hieu Nguyen.
    PS: I am developing on Window OS and Visual C++ development tool.

    Thanks Aandi Inston and Marcus Phillips for your answer.
    In thread I just use Named Pipe inter-process communication mechanism to send signal to the other application. So I do not use any Photoshop API.
    However, it is strange that I can not put my Thread in begin of PluginMain function:
    DLLExport SPAPI SPErr PluginMain
    ( char* caller, char* selector, void* message)
    SPErr error = kSPNoError;
    SPMessageData *basicMessage = NULL;
    SPPluginRef plugInRef = NULL;
    SPErr err = 0;
    basicMessage = (SPMessageData *) message;
    sSPBasic = basicMessage->basic;
    gPlugInRef = basicMessage->self;
    MyThread();/*CAN NOT RUN THE THREAD!!!!*/
    I must change my Thread function to position after checking caller parameter
    Please show me the reason why?
    Thanks,

  • Why are there 2 methods to create thread ?

    Hi,
    To create threads, there are two methods
    1) Inherit the THREAD super-class
    2) Implement the interface RUNNABLE.
    The reason for providing two methods is that, the user can only one level of "implementation inheritance". That is the reason, which comes immediately to mind. But is there another reason(s)? If yes, than what is the reason??
    Any help would be welcome
    Thanks in advance

    I was one of those authors. We all read some other
    author who said the same dumb thing LOL, been there, done that, you have my sympathy :-)
    Could you explain your use of the words "policy" and
    "mechanism"? I completely agree with your conclusion,
    but don't really understand your argument.This is one of the things that I've taken from my experiences with the X Window System (tm, I think). "Mechanism, not policy" was one of the mantras that would be repeated by every author. As I understood it, the idea was that the X protocol, Xlib, and even Xt prescribed the mechanism for a program's interaction with windows on a client screen, but did not prescribe how those windows would interact with the user. That was the "policy" to be implemented by the toolkit and application layers (thus the different appearance of Motif, OpenLook, Xaw, &c, even though they used the same underlying code up through the toolkit).
    I like the mantra, and as I've come to understand OO programming, I try to apply it as a way to identify what could/should be abstracted and what needs to remain concrete. If something abstracts a basic service that can be used in multiple ways -- like threads -- I consider that mechanism. If something is closely tied to the way my application works, I consider that policy. The former are implemented with interfaces and abstract classes, and do not contain application-specific code; the latter are implemented with instantiable classes.

  • Creating Threads in Java Stored procedures

    Can I create threads inside Java Stored procedures?
    or is there a restriction?
    Thanks
    Kal

    Can I create threads inside Java Stored procedures?
    or is there a restriction?
    Thanks
    Kal Hi Kal,
    I don't mean to be rude, but have you tried it? Personally, I
    haven't tried it (since I didn't have the need).
    You don't say what version of Oracle DBMS you are using, but I
    am using 8.1.7.3 on Solaris 7, and according to Oracle's
    "Oracle 8i Java Developer's Guide", there is no restriction
    (of-course, that depends on what you call a "restriction" :-)
    http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/java.817/a83728/03writ11.htm#1003094
    Hope this helps.
    Good Luck,
    Avi.

  • Listeners, load a class on startup and creating threads in infinite loop

    This is an identical post to the one I made in the jsp forum. I do this as I know, being a regular here, that there are equally good people(in j2ee web application development) in both these forum, but many of them stick to their particular forums of choice - jsp / servlets.
    I was wondering if there is any means by which I could launch my own class when tomcat starts (in the same jvm).
    1. I need one or more Thread/TimerTask because the requirement is such that the application would have continous data drops (in the form of logs) which has to be picked up, parsed and pushed into a db. Another part of the application reads the data from the db on requests (http) and displays it over the web. The thread has to poll for arrival of new logs and then hand it over to a framework for parsing and inserting the parsed data to a db.
    2. I know that I can possibly use a servlet with a load-on-startup value greater than 1 and code my requirement into the init method. However, using a servlet for a functionality different from servicing http requests has me worried. (valid ?), not to mention the fact that Iam very uneasy about creating threads from within Servlets.
    3. I googled hard and found that I could probably use a tomcat specific context lifecycle listener.
    4. I could also possibly use the servlet api - the ServletContextListener.
    5. I have rejected #2 and settled on either #3 or #4 - the ServletContextListener or Tomcat specific Lifecycle Listener, though the later, as I said binds me to Tomcat (which is ok for me). Are there any other specific (dis)advantages of using either especially when I have to create threads from within them (on context startup)? Other than memory leaks, killing the thread objects & associated resources on context shutdown, is there anything else that I need to watch out for while using threads.
    6. I wonder is there is there a plain startup hook available in tomcat (rather than listeners) - from where I can launch a class that starts a thread in the same jvm as tomcat's ?
    Thanks In Advance,
    Ram.

    Anybody ? Sorry for bumping up.
    Thanks,
    Ram.

  • Creating Threads in EJBs

    Hi,
    I know that you are not allowed to create threads inside EJBs. However, can an EJB call some java networking code that creates threads for its purpose?
    In other words, how far does this prohibition on threads go? You can't even call some code that creates threads inside an EJB or is it that you just can't create threads inside the EJB class itself?
    Thanks,
    Y.

    I know that you are not allowed to create threads
    inside EJBs. However, can an EJB call some java
    networking code that creates threads for its
    purpose?Although the specs don't allow you, they don't completely rule out the possibility.
    In other words, how far does this prohibition on
    threads go? You can't even call some code that
    creates threads inside an EJB or is it that you just
    can't create threads inside the EJB class itself?
    http://www.theserverside.com/discussions/thread.tss?thread_id=31118This discussion should throw some light.

  • Creating threads in init for servlet (advanced)

    Hello
    we have a servlet ..in servlets init method we are creating new threads by calling the Timer class like this
    BGMSchedul = new Timer(true);
    BGM = new BackManager();
    BGMSchedul.scheduleAtFixedRate(BGM, 10000, 30000); //every 30 secondsProblem is that during our stress testing on IBM WSAD we've noticed errors like J2CA0075W: An active transaction should be present
    Upon researching this issue further i found this link http://www-1.ibm.com/support/docview.wss?rs=180&uid=swg21231761
    which i think suggests that the servlet shouldnt be creating threads which make J2C connections. Our thread is making the DB connection.
    does nay one have experince with this sort of problem? is it a bad programming construct to create threds in a servlet? if so..where should we be creating our threads? we want this thread to run every 30 seconds and this is a web appliction.
    I'd appreciate any help

    I've created a POJO class that implements servletcontextlistener and took out the time thread from servlet and placed it in pojo's contextInitialized method. however, i still get the same warning.

  • Creating threads in Weblogic

    For a variety of reasons I need to write my own messaging bridge between Weblogic and MQ. The reasons have been validated by BEA, so I'm not completely off my rocker :)
    I can either write this as a standalone java application that acts as a client to weblogic's JMS server, or as a deployed webapp (using the ServletContextListener method to start/stop it). Either way the app will <shudder>create one thread per queue</shudder> and listen on that queue until a message arrives.
    The pros of a deployed application (cost-free clustering, management, can use a webapp to manage the threads/queues, etc) leads me in that direction, but creating threads in a J2EE server dubious at best.
    Ideally this webapp runs in its own execute queue, and the holy grail is to have the threads run in that execute queue. However, there doesn't seem to be any supported way to create threads from an execute queue.
    Has anyone done anything like this? Any suggestions on how to spawn and manage the threads properly? Should it be deployed or stand-alone?
    cheers
    mike

    Hello,
    The webapp route sounds better to me than a standalone java app, you will get things up and running a lot more quickly and get all the goodies associated with webapps.
    You don't explicity create threads from the queue for example in the way you get connections from a connection pool. Once you have created and configuered your execute queue you just add a few init parameters to your web.xml deployment descriptor:
    <servlet>
    <servlet-name>MainServlet</servlet-name>
    <jsp-file>/myapplication/critical.jsp</jsp-file>
    <init-param>
    <param-name>wl-dispatch-policy</param-name>
    <param-value>CriticalAppQueue</param-value>
    </init-param>
    </servlet>
    see:
    http://e-docs.bea.com/wls/docs81/perform/AppTuning.html#1105201
    for complete instructions.
    cheers
    Hussein Badakhchani
    www.orbism.com

  • Unable to create thread from startup class

    Hi,
    We are trying to create thread from our scheduler class. This scheduler class
    is called from a Startup class configured in WebLogic 7. But we failed to create
    thread. It does not showing any error also. Can anyone plz suggest what could
    be the problem.
    Thanks & Regards,
    Siddhartha

    Hi,
    We are trying to create thread from our scheduler class. This scheduler class
    is called from a Startup class configured in WebLogic 7. But we failed to create
    thread. It does not showing any error also. Can anyone plz suggest what could
    be the problem.
    Thanks & Regards,
    Siddhartha

Maybe you are looking for

  • MacBook Pro 15 (late 2013) Queries

    Hello I am planning to buy the new mbpr 2.3ghz with dual graphics. But I have a few questions. 1. THE OVERHEAT ISSUE. Is it sorted ??? or do i still have to worry about that ?? If it is still persistent, is there any solution or should I wait for the

  • Acrobat SDK plugin in Visual Studio 2012

    Hello I am trying to develop a plugin for Acrobat SDK. We are using Visual Studio 2012 here at work but as the samples seemed to require using Visual Studio 2010 I had to resort to downloading Microsoft Visual C++ 2010 Express and trying to run the e

  • How to disable my ipad

    well this morning my ipad was disabled now i cant get i from unlocking so i need help unlocking my ipad

  • Xbox Controller on a G4 iBook

    This topic seems to have been 'beat to death' on line but I've spent 3 days reading posts and trying all the instructions without success. The iBook does see the controller, it shows up in "About this Mac" and USB Prober sees it as well, but both the

  • Two questions about Preview

    In earlier OS versions, particularly on the MacWorld website, I was able to find a workaround so that PDFs do not automatically open in Safari - and that they are downloaded and pop-up immediately in Preview. Here are my two questions: 1. Does anyone