Dynamic JNDI name for database adapter in BPEL

Hi All,
I am having some major issues trying to make the JNDI location for the database adapter dynamic (10.1.3.4). I already went through the followin link, but that didnt work for me: http://www.oracle.com/technology/pub/articles/bpel_cookbook/carey.html
The below example works, but only the first run. Second time around the first runs JNDI value gets retained and connects to that database.
This is what worked atleast the first time.
I parameterized the JNDI with a variable defined in the partnerlink definition in the bpel.xml
In Bpel. xml
<partnerLinkBinding name="updatetbl">
<property name="wsdlLocation">updatetbl.wsdl</property>
<property name="CONN">eis/DB/na</property>
<property name="retryInterval">60</property>
</partnerLinkBinding>
In the updatetbl.wsdl file
<service name="updatetbl">
<port name="updatetbl_pt" binding="tns:updatetbl_binding">
<jca:address location="$CONN"/>
</port>
</service>
At run time I change the partnerlink CONN variable in embedded Java.
try
Element targetAdapterElement =(Element)getVariableData("Invoke_getFromTbl_OutputVariable","getFromTblOutputCollection","/ns2:getFromTblOutputCollection/ns2:getFromTblOutput/ns2:SRC_JNDI");
getLocator().lookupProcess("JndiIssueTest").getDescriptor().getPartnerLinkBindings().getPartnerLinkBinding ("updatetbl").setPropertyValue ("CONN",targetAdapterElement.getTextContent());
("updatetbl").getPropertyValue ("CONN"));
catch(Exception ex)
addAuditTrailEntry("Error is " + ex);
This works fine the first time, but the second time I run it to look at a different CONN value, it somehow still connects using the first runs value!
If I redeploy or clear the WSDL cache, it works. But we plan to run it multiple times from several environment so manually or programatically clearing WSDL is not the right solution.
Can someone tell me what is the standard process of doing this so it works everytime?
Thanks,
Shaf

Shaf,
Please refer the mail thread for details. If you want I can send you(send me your email id) the sample BPEL process which uses Dynamic JNDI.
Re: How to externalize JNDI name (setting JNDI name dynamically)
Thanks,
Sen

Similar Messages

  • What kind of database driver should use for database adapter  in BPEL?

    what kind of database driver (XA or non-XA) should use for database adapter in BPEL? I have only one database adapter and no JMS.
    Thanks
    Jo
    Edited by: 799095 on Sep 30, 2010 8:35 AM

    Hi
    It depends on wheter you need XA transaction or not.
    See http://www.theserverside.com/discussions/thread.tss?thread_id=21385 third reply.
    If you only have one database and no synchronous dependency to the caller, non-XA should be OK.
    -Johan

  • Where is user name and password stored for database adapter

    dear all,
    does any body know where is the password stored in database adapters.
    I noticed it mentioned in wsdl file in encrypted format, but is there any other place it stored.
    a ) before deployment
    b) aftre deployment .
    Thanks in advance .
    Regards
    Arc

    you will notice a JNDI name for this e.g. eis/DB/... this is used to look at the Application Server configuration. If it doesn't exist then it will use the credentials used as design time. Not good asthe connection will be fore development mainly.
    you can safely remove the mcf setting from the wsdl so it will always force the AS connection. this is good practice.
    To configure the AS configuration there is the oc4j-ra.xml file for the DB adapter. Or you can configure in Enterprise Manager
    EM -> oc4j_soa (home if basic install) -> Administration -> JDBC Resources
    configure a connection pool and data source
    then create a JNDI name entry for the DB adapter
    EM -> oc4j_soa (home if basic install) -> Applications -> Drop Down box select Adapter Resources -> DB Adapter
    Use the examples. You will see that the connect string = jdbc/DBName
    cheers
    James

  • Dynamic where clause in database adapter

    Hi
    I have requirement to develop SOA service for search page! The back-end query for search is required to have where clauses to be appended to SELECT statement dynamically depending upon search criteria the user selects!
    E.g. if user is searching employee from a portal! If employee selects mobile number of the employee, or joining date range or other criteria, then accordingly appropriate clauses are to be appended to SEARCH SELECT statement.
    Can we achieve same while implementing executing database query through database adapter from BPEL service?
    Thanks In Advance
    Priyadarshi 

    It is difficult using the standard database adapter approach. You may have to use nested sql queries.Following is a good example of the same.
    Neeraj Sehgal - Experimenting with SOA: Pass multiple parameters, dynamic query in Pure SQL in Database Adapter
    If your only problem in using this that you are hard coding the connection details  , you can use the datasource jndi name in the query. hence you will not be required to change your code when moving from one env to other env. You just have to take care of keeping the jndi name same in all the env.

  • How to use Database Adapter in BPEL

    I want to use Database Adapter in BPEL to transfer data from one table to other table and the data is still hold in the read table?
    I can find a example from http://download.oracle.com/docs/cd/B31017_01/integrate.1013/b28994/adptr_db.htm#BDCIGDCB.
    And the general design of my BPEL is as following:
    1. Add a "status" column to the read table. And alter the value of status column of all data in read table to "unreaded".
    2. Then create a empty BPEL (BPELAdapter) Project.
    3. Add a Database Adapter:
    (1) In step 1 of Adapter Configuration Wizard, configure the Service Name to datain.
    (2) In step 2, configure the database connection.
    (3) In step 3, choose "Poll for New or Changed Records in a Table".
    (4) Then click Import Tables button, and choose the read table.
    (5) In step 5, choose a column.
    (6) Don’t do anything in step 6 and 7.
    (7) In step 8, choose "Update a Field in the [Datain] Table (Logical Delete)".
    (8) In step 9, configure Logical Delete Field to STATUS, configure Read Value to readed and configure Unread Value to unreaded.
    (9) Don’t do anything in step 10 and 11.
    4. Add a receive activity to connect to above database adapter.
    5. Add another Database Adapter. Then configure this database adapter service WSDL:
    (1) In step 1 of Adapter Configuration Wizard, configure the Service Name to dataout.
    (2) In step 2, configure the database connection.
    (3) In step 3, choose Perform an Operation on a Table (and all items under it).
    (4) Then click Import Tables button, and choose the write table.
    (5) In step 5, choose a column.
    (6) Don’t do anything in step 6, 7 and 8.
    6. Add a invoke activity to connect to above database adapter.
    7. Add a assign activity between the receive activity and invoke activity. And configure the assign copy operation.
    But after I deploy this BPEL project to the BPEL server and invoke this project, I get following error. Meanwhile, this BPEL don't take effect.
    The following exception occured while processing this request:
    Can't find partnerLinkType 2.
    in
    "file:/D:/soft/SOASuite/product/10.1.3.1/OracleAS_1/bpel/domains/default/tmp/.bpel_BPELAdapter_1.0_e82210b05e4d3e997eed581d0d220293.tmp/_BPELAdapter.wsdl" WSDL to find PartnerLinkType "{http://xmlns.oracle.com/pcbpel/adapter/db/datain/datain_plt"。
    How to resolve?
    Thanks,
    Melody

    Now, I can insert data into the table through Database Adapter.
    But still can't select data from the table through Database Adapter.
    Above error still happen when invoke the read database table with Database Adapter project:
    Can't find partnerLinkType 2.
    in
    "file:/D:/soft/SOASuite/product/10.1.3.1/OracleAS_1/bpel/domains/default/tmp/.bpel_BPELAdapter_1.0_e82210b05e4d3e997eed581d0d220293.tmp/_BPELAdapter.wsdl" WSDL to find PartnerLinkType "{http://xmlns.oracle.com/pcbpel/adapter/db/datain/datain_plt"。

  • Dynamic jndi-name in weblogic-ejb-jar.xml

    Is there a way to create dynamic (i.e. runtime) jndi-names for EJBs instead of
    (or in addition to) "hard coding" them in the weblogic-ejb-jar.xml file? What
    I'm trying to do is have one WebLogic instance (JVM) host multiple environments
    (our Beta and Training environments) and I simply want to deploy the same .ear
    file twice but have each environment (application - .ear) reference a different
    database schema (jdbc connection pool). I have everything working just fine for
    this scenario except when I define jndi-names for our ejbs. The problem is that
    I am really deploying the same ejbs (jndi-names and actually code base) in each
    applicatoin instance and I get an exception when the WebLogic is trying to deploy
    the second application (.ear) because the jndi-names in it have already been deployed
    by the first application instance. I recieve a jndi error stating that the name
    is already deployed.
    Or is there a better path to go down for what I am trying to do to have one WebLogic
    instance support our beta and training environments? Usually (but not always)
    our code base is the for same for both of these environments, I simply need to
    have each environment use a different database schema.
    Thanks

    A little birdie tells me that BEA does this very thing. Looking at the
    descriptors for WebLogic Portal I see:
    <weblogic-enterprise-bean>
    <ejb-name>LoaderEJB</ejb-name>
    <enable-call-by-reference>True</enable-call-by-reference>
    <jndi-name>${APPNAME}.BEA_content.LoaderHome</jndi-name>
    </weblogic-enterprise-bean>
    Yes, the ${APPNAME} token really is expanded into the J2EE application
    name at deployment time!
    Sincerely,
    Daniel Selman
    Bryan Dixon wrote:
    Rewriting our build process isn't really much of an option for me. Our current
    build process is too complex and time consuming right now to convert to Ant (we
    eventually will do this but not for a while). So are there any other ideas that
    aren't build related?
    Thanks
    "Eric Ma" <[email protected]> wrote:
    You don't need run-time dynamism in JDNI names and it can't be done anyways.
    You
    need token substitution in XML configuration files when building the
    app. If
    you are using Ant for building, then it is a breeze. If not, first convert
    your
    build process to use Ant.
    Also, a single WLS instance hosting multiple environments sounds really
    INTRIGUING
    to me.
    Eric Ma
    "Bryan Dixon" <[email protected]> wrote:
    Is there a way to create dynamic (i.e. runtime) jndi-names for EJBsinstead
    of
    (or in addition to) "hard coding" them in the weblogic-ejb-jar.xml file?
    What
    I'm trying to do is have one WebLogic instance (JVM) host multiple environments
    (our Beta and Training environments) and I simply want to deploy the
    same .ear
    file twice but have each environment (application - .ear) referencea
    different
    database schema (jdbc connection pool). I have everything working just
    fine for
    this scenario except when I define jndi-names for our ejbs. The problem
    is that
    I am really deploying the same ejbs (jndi-names and actually code base)
    in each
    applicatoin instance and I get an exception when the WebLogic is trying
    to deploy
    the second application (.ear) because the jndi-names in it have already
    been deployed
    by the first application instance. I recieve a jndi error stating that
    the name
    is already deployed.
    Or is there a better path to go down for what I am trying to do to have
    one WebLogic
    instance support our beta and training environments? Usually (but not
    always)
    our code base is the for same for both of these environments, I simply
    need to
    have each environment use a different database schema.
    Thanks

  • Password indirection for database adapter

    Does the database adapter support the use of thge password indirection feature? I refer to the topic Creating an Indirect Password in the OC4J J2EE Security Guide, see http://download-east.oracle.com/docs/cd/B14099_15/web.1012/b14013/passman.htm#sthref746,
    oc4j-ra.xml is not listed.

    you will notice a JNDI name for this e.g. eis/DB/... this is used to look at the Application Server configuration. If it doesn't exist then it will use the credentials used as design time. Not good asthe connection will be fore development mainly.
    you can safely remove the mcf setting from the wsdl so it will always force the AS connection. this is good practice.
    To configure the AS configuration there is the oc4j-ra.xml file for the DB adapter. Or you can configure in Enterprise Manager
    EM -> oc4j_soa (home if basic install) -> Administration -> JDBC Resources
    configure a connection pool and data source
    then create a JNDI name entry for the DB adapter
    EM -> oc4j_soa (home if basic install) -> Applications -> Drop Down box select Adapter Resources -> DB Adapter
    Use the examples. You will see that the connect string = jdbc/DBName
    cheers
    James

  • Dynamic File name in File Adapter

    Hi,
    I have a requirement to pass dynamic file name in File Adapter.
    Is there any way to pass a variable for the file name attribut in file adapter.
    I am looking for some options apart from %yyMMddHHmmss%,%SEQ%...etc
    Please suggest if any of you have information on how to put values from a variable to file name attribute in file adapter
    regards
    Saiju

    Hi Saiju,
    Yes there is.
    Assign your file name to a variable, let's say 'fileName'.
    Now go to your invoke activity(for the specific fileadapter) -> Property tab-> find a property call jca.file.FileName -> in the value field assign 'fileName' variable.
    That's it... (assuming you are using 11g)
    Arik
    Edited by: Arik on Jun 27, 2012 3:12 PM

  • Build dynamic SQL query in Database Adapter.

    Hi All,
    I have a requirement to build dynamic sql query at Database Adapter.
    My BPEL process is getting search spec as input from siebel. I need to process this searchspec in BPEL and need to build the SQL query dynamically at Database Adapter to fetch the records from DB.
    it goes like this....
    1. Sieble Search Spec: city1 OR city2 OR city3 OR city4 .....
    I need to build query as
    select * from S_ADDR_PER where city like 'city1' OR city like 'city2' OR city like 'city3' OR city like 'city4' ......
    2. Siebel Search spec: city1 AND country1 AND state1....
    I need to build query as
    Select * from S_ADDR_PER where city like 'city1' AND country like 'country1' AND state like 'state1' ....
    3. Siebel Search spec: state
    I need to build query as
    select * from S_ADDR_PER where state like '%state%';
    Is it feasible in Database Adapter? if its Yes.
    Any guidelines to achieve this?
    Thank you
    Chandra

    Hi All,
    I have a requirement to build dynamic sql query at Database Adapter.
    My BPEL process is getting search spec as input from siebel. I need to process this searchspec in BPEL and need to build the SQL query dynamically at Database Adapter to fetch the records from DB.
    it goes like this....
    1. Sieble Search Spec: city1 OR city2 OR city3 OR city4 .....
    I need to build query as
    select * from S_ADDR_PER where city like 'city1' OR city like 'city2' OR city like 'city3' OR city like 'city4' ......
    2. Siebel Search spec: city1 AND country1 AND state1....
    I need to build query as
    Select * from S_ADDR_PER where city like 'city1' AND country like 'country1' AND state like 'state1' ....
    3. Siebel Search spec: state
    I need to build query as
    select * from S_ADDR_PER where state like '%state%';
    Is it feasible in Database Adapter? if its Yes.
    Any guidelines to achieve this?
    Thank you
    Chandra

  • Help needed on allocating a JNDI name for MYSQL on Glassfish

    Hi,
    I am trying to invoke my database (MYSQL) through a JNDI lookup on GlassFish Server. I copied the MySQL connector into the GLASSFISH_HOME/lib directory and went into Admin console (http://localhost:8080/login.jsf) to create a ConnectionPool. After this, I am not sure what I should do, inorder to associate a "jdbc/mysql" JNDI name for this pool. Can anybody point me to what has to be done?
    Thank you.

    Figured it. After you've setup your pool, you need to go to Resources -> JDBC -> JDBC Resources and then create an new mapping of the pool that you've just created to some name (ex: "java/mysql"); This should integrated Glassy with Mysql
    Thanks.

  • Deploytool: Can't specify a JNDI name for RA

    Using j2eesdk1.4_beta2, it appears there is no way to specify a JNDI name for a Resource Adapter. Is there a default name I can use to look up my RA if I don't specify a name? The Deploy Tool help describes some tabbed panes appear to be missing from the appication. Is there a way to work around this problem until the final release comes out?

    Headache!... That's what is expecting you in the DeployTool.
    The deploytool generates invalid deployment descriptors for Resource Adaptors.
    As you mentioned, it doesn't allow you to select a ResourceAdaptor implementation. In my case, I'm using my own Connection and ConnectionFactory and it didn't allow me to choose an implementation class for either interface neither.
    I solved these problems by downloading XMLSpy and using the XML Schema to fill-in the gaps in the ra.xml descriptor. There I had also to include other mandatory elements that where not written by the deployTool, like: <display-name>
    <vendor-name>
    <eis-type>
    <resourceadapter-version>
    Regarding to the <<null>> error, it has to deal with an invalid sun-ra.xml. It's either empty or it's missing a mandatory element. I used again XML Spy here to give a JNDI to my adaptor.
    I thought I was through it but I still can't deploy on the server. When I try, I get the following error:
    <[INFO][j2eesdk1.4_beta2][][][12][javax.enterprise.system.tools.admin][03.november.2003 22:16:22:351 CET][ADM5604:Processing config change [Domain:add to xpath=/domain/applications
    childXPath = /domain/applications/connector-module[@name='SimpleRAR1']]]>
    <[INFO][j2eesdk1.4_beta2][][][12][javax.enterprise.system.tools.admin][03.november.2003 22:16:23:302 CET][ADM1041:Sent the event to instance:[ModuleDeployEvent -- deploy connector/SimpleRAR1]]>
    org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
    [.... 200 lines stack trace ....]
    <[WARNING][j2eesdk1.4_beta2][][][12][javax.enterprise.system.tools.admin][03.november.2003 22:16:24:043 CET][ADM5603:Event listener error [null]]>
    So far I haven't found a way to get solve this one. The <NAMESPACE_ERR> makes me think about the infamous 'locale' error of the deploytool, but I included the JVM parameters [USER_LANG=en,USER_REGION=US,USER_COUNTRY=US] in the server startup and it didn't change anything.
    If you get further than that, please let me know.
    -regards,
    Gerard.

  • Dynamic UserID/Password for file Adapter

    Hi,
    How to use dynamic UserId/Password for file adapter ?
    (Sender/Receiver)
    In our case the Id/Pwd of FTP Site changes freguently.
    Can anyone help.
    Thanks in Advance
    Regards
    Chemmanz

    Hi Chemmanz,
    >>>>In our case the Id/Pwd of FTP Site changes freguently.
    but do you have those passwords in the message payload?
    if not then you will still have to fill it somewhere right?
    BTW
    the only way would be to use java proxies and write a simple ftp adapter inside it (or your own adapter)
    but this is not possible in standard I believe
    Regards,
    michal

  • Help on Dynamic queue name in JMS Adapter

    Hi Experts,
      Could you please explain how to configure dynamic queue name in JMS Adapter.
    My requirement is i would have to add the date and time to JMS Queue Name in receiver JMS Adapter.
    Thanks in Advance
    Chilla

    hi,
    as it's not in Adapter-Specific Message Properties
    http://help.sap.com/saphelp_nw04/helpdata/en/10/b1b4c8575a6e47954ad63438d303e4/content.htm
    looks like you cannot do it with jms adapter in standard
    use proxy or your own adapter instead
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Specify JNDI Name For EJB Module

    Hi folks, please I need to know how I can specify the Jndi name for an ejb module I am creating in netbeans 5.0, to be accessed by a web application.
    If this can be done using the sun java system application server 9 admin consle (just as for JDBC Resources), i'll also like to know how.
    Thanks.

    Thanks Jay. I went through the links, it seems that if you have the JNDI name set in the weblogic-ejb-jar.xml, there is no need to set the same in the weblogic admin console. I am using ejb 2.x version. Particularly if you get the WLInitialContextFactory in your code , then there is no need to set the JNDI name in the JNDI tree in weblogic admin console.
    Like:-
    Context ctx = null;
    java.sql.Connection conn = null;
    Hashtable<String,String> ht = new Hashtable<String,String>();
    ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
    ht.put(Context.PROVIDER_URL,"t3://localhost:7001");
    This will take care of JNDI tree, hence there is no need to set the JNDI name explictly in the weblogic admin console.
    Please correct me if i am wrong. Whether for datasource also whether we can do the same, by setting the resource-ref with datasource in the ejb-jar.xml and not set anything in weblogic admin console? Thanks.

  • Looking up JNDI names for local client

    Sir,
    I have been trying to look up JNDI name for the local home interface in the client program.But I got only "javax.naming.NoInitialContextException".I want information about to give a JNDI name for EJB and its details.
    Thanking you.
    Yours,
    R K Ramesh

    It sounds like you are not specifying the right URL or username/credentials to get an initial context.
    A typical example would be something like this:
    Properties p = new Properties();
    p.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    p.put(Context.PROVIDER_URL, "t3://server:port");
    InitialContext ic = new InitialContext(p);
    (You can also use a properties file or system prpoerties to specify these.)
    -- Rob
    WLS Blog http://dev2dev.bea.com/blog/rwoollen/

Maybe you are looking for