Best practice for calling application module methods and plsql code

In my application I am experiencing problems with connection pooling, I seem to be using a lot of connections in my application when only a few users are using the system. As part of our application we need to call database procedures for business logic.
Our backing beans, call methods on the application module which in turn call a database procedure. For instance in the backing bean we have code like this to call the application module method.
// Calling Module to generate new examination/test.
CIGAppModuleImpl appMod = (CIGAppModuleImpl)Configuration.createRootApplicationModule("ky.gov.exam.model.CIGAppModule", "CIGAppModuleLocal");
String testId = appMod.createTest( userId, examId, centerId).toString();
AdfFacesContext.getCurrentInstance().getPageFlowScope().put("tid",testId);
// Close the call
System.out.println("Calling releaseRootApplicationModule remove");
Configuration.releaseRootApplicationModule(appMod, true);
System.out.println("Completed releaseRootApplicationModule remove");
return returnResult;
In the application module method we have the following code.
System.out.println("CIGAppModuleImpl: Call the database and use the value from the iterator");
CallableStatement cs = null;
try{
cs = getDBTransaction().createCallableStatement("begin ? := macilap.user_admin.new_test_init(?,?,?); end;", 0);
cs.registerOutParameter(1, Types.NUMERIC);
cs.setString(2, p_userId);
cs.setString(3, p_examId);
cs.setString(4, p_centerId);
cs.executeUpdate();
returnResult=cs.getInt(1);
System.out.println("CIGAppModuleImpl.createTest: Return Result is " + returnResult);
}catch (SQLException se){
throw new JboException(se);
finally {
if (cs != null) {
try {
cs.close();
catch (SQLException s) {
throw new JboException(s);
I have read in one of Steve Muench presentations (Oracle Fusion Applications Team' Best Practises) that calling the createRootApplicationModule method is a bad idea, and to call the method via the binding interface.
I am assuming calling the createRootApplicationModule uses much more resources and database connections that calling the method through the binding interface such as
BindingContainer bindings = getBindings();
OperationBinding ob = bindings.getOperationBinding("customMethod");
Object result = ob.execute()
Is this the case? Also is using getDBTransaction().createCallableStatement the best way of calling database procedures. Would it be better to expose plsql packages as webservices and then call them from the applicationModule. Is this more efficient?
Regards
Orlando

Thanks Shay, this is now working.
I successfully got the binding to the application method in the pagedef.
I used the following code in my backing bean.
package view.backing;
import oracle.binding.BindingContainer;
import oracle.binding.OperationBinding;
public class Testdatabase {
private DCBindingContainer bindingContainer;
public void setBindingContainer (DCBindingContainer bc) {this.bindingContainer = bc;}
public DCBindingContainer getBindingContainer() {return bindingContainer;}
public static String validateUser()
// Calling Module to validate user and return user role details.
System.out.println("Getting Binding Container from Home Backing Bean");
BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
System.out.println("Obtain binding");
OperationBinding operationBinding = bindings.getOperationBinding("calldatabase");
System.out.println("Set username parameter");
operationBinding.getParamsMap().put("p_userId",userId);
System.out.println("Set password parameter");
operationBinding.getParamsMap().put("p_testId",examId);
Object result = operationBinding.execute();
System.out.println("Obtain result");
String userRole = result.toString();
System.out.println("Result is "+userRole);
}

Similar Messages

  • Best practice for calling an AM method with parameters

    Which will be the best way to call an AM method with parameters from a backing bean.
    I usually use the BindingContainer to get the operation binding and then call execute function. But when the method have parameters, how to do it?
    Thanks

    Hi,
    same:
    operationBinding.getParamMap().put("argument1Name", argument1Value);
    operationBinding.getParamMap().put("argument2Name", argument2Value);
    operationBinding.execute();
    Frank

  • Best Practice for Commit() after custom method on struts action

    Hi all,
    I'm curious what's the best way to commit programmatically after an application module custom method, wired to a struts action, inserts a row into a view object.
    Right now I do this:
    vo.insertRow(theRow);
    vo.executeQuery();
    getDBTransaction.commit();
    Then, I wire a struts action after the one calling the custom method, and drag a commit onto that as well. Is there a better way? I wanted to make sure...
    Thanks.

    John,
    it seems that your are commiting it twice then.
    On another issue, don't program directly against View objects in your Struts Action. Write a method on the YourApplicationModuleImpl class and expose this to the client. Have this method handle the update and commit on the server. In the Action simply call the method exposed method from the YourApplicationModule.
    Frank

  • Highly Required CRM 5.0 Best practices for CRM Service Module

    Dear all,
    I have been searching for CRM 5.0 version best practices in Internet quiete a long period, but could not find anywhere.
    currently SAP is providing only best practices for SAP CRM 2007 version.
    since most of configuration is differing because of Webclient Interface, I request you to refer a source from where I can get the CRM 5.0 Best Practices for Service module.
    Your suggestions and help will be highly appreciated.
    Best regards
    Raghu ram

    Hi Srini,
    <removed by moderator>
    Thank you & Best regards
    Raghu ram
    Edited by: Raghu Ram on Jul 16, 2009 6:09 AM
    Edited by: Raghu Ram on Jul 16, 2009 6:11 AM
    Moderator message please review the rules of engagement located here:
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/home/rulesofEngagement
    Edited by: Stephen Johannes on Jul 16, 2009 8:12 AM

  • Best Practice for External Libraries Shared Libraries and Web Dynrpo

    Two blogs have been written on sharing libraries with Web Dynpro DC, but I would
    like to know the best practice for doing this.
    External libraries seem to work great at compile time, but when deploying there is often an error related to the external library not being a deployed component. 
    Is there a workaround for this besides creating a shared J2EE library which I have been able to get working?  I am not interested in something that works, but really
    what are the best practice for this. What is the best way to  limit the number of jars that need to be kept in a shared library/ext library.  When is sharing ref service/etc a valid approach vs. hunting down the jars in the portal libraries etc and storing in an external library.

    Security is mainly about mitigation rather than 100% secure, "We have unknown unknowns". The component needs to talk to SQL Server. You could continue to use http to talk to SQL Server, perhaps even get SOAP Transactions working but personally
    I'd have more worries about using such a 'less trodden' path since that is exactly the areas where more security problems are discovered. I don't know about your specific design issues so there might be even more ways to mitigate the risk but in general you're
    using a DMZ as a decent way to mitigate risk. I would recommend asking your security team what they'd deem acceptable.
    http://pauliom.wordpress.com

  • Best practice for version control B2B, ESB and BPEL

    Hello,
    we are setting up a new system using B2B, ESB and BPEL. The development team is more experienced working with PL/SQL, Oracle Workflow and we are worried that Jdeveloper generates changes to the source files during development and that we might have problems with the version control.
    Is there any best practice for setting up version control for these systems? Do we need to take anything in particular into consideration when setting up the projects?
    We are using Serena Dimensions 9.1 for version control with the add-on in Jdeveloper.
    Thanks in advance!

    I believe JDeveloper has a plugin for Dimensions.
    I havent used it but to get it, go to tools (It may be help I don't have JDeveloper on this machine to confirm) check for updates.
    If you select the thrid party check box - next, you will see an entry for dimentions.
    Configure the connection and develop as you would any other project.
    cheers
    James

  • Manage bean methods not able to call application module methods

    Hi,
    I have an ADF application where in my managed bean method needs to call AppModuleImpl methods. I use the code as below:
    public void getSummary() {
    DCBindingContainer binding = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    OperationBinding op = binding.getOperationBinding("getVOData");
    op.execute();
    The code works fine when I run the application in my IntegratedWeblogicServer and I am able to get the data on my .jsp pages.
    I have installed weblogic server on another machine and I need to deploy and run my application on that server. But when I try doing that, the above code is not able to call the AppModule method and I see no data on my page (Also there is no error or exceptin thrown). Seems that the ViewController project is not able to interact with the Model project.
    Is there any extra configuration to be done on the newly installed weblogic server to get this work? Or will some change in the application code help?
    Please suggest.
    Thanks and regards,
    Ansh

    Hi,
    While creating the weblogic domain, we had the following checkboxes checked:
    1. Basic weblogic server domain [wlserver_10.3]
    2. Oracle JRF [oracle_common]
    I hope this is what we need.
    Yes, I also have the adf runtime installed.

  • Best Practice for calling CFC

    Hi,
    In a web application, if I need to call a CFC method from a different CFC, what would be considered as the best way of doing it?
    For example, let's say I have two components: Customer and Product.  From a method functionA in Customer, I would like to call functionB in Product.  I can do one of the following, but which way is best practice and why?
    1.  Create a Product object in functionA, and use it to call functionB
    <cfcomponent name="Customer">
         <cffunction name="functionA">
              <cfset productObj = createObject('component', 'Product')>
              <cfset productObj.functionB()>
         </cffunction>
    </cfcomponent>
    2.  Pass a Product object when we initialize a Customer object, and use that to call functionB
    <cfcomponent name="Customer">
         <cffunction name="init">
              <cfargument name="productObj">
              <cfset variables.productObj = arguments.productObj>
         </cffunction>
         <cffunction name="functionA">
              <cfset variables.productObj.functionB()>
         </cffunction>
    </cfcomponent>
    3.  Assume that Customer object has access to the Product object in the application scope
    <cfcomponent name="Customer">
         <cffunction name="functionA">
              <cfset application.productObj.functionB()>
         </cffunction>
    </cfcomponent>
    Thank you very much.

    The first two are fine.  If the CFC being called is always gonna be the exact same one, then there's no prob directly referencing it in the calling CFC.  If the CFC could vary, then pass it in.
    If you're only using the CFC transiently, then you could use <cfinvoke> as well in this case.
    Directly accessing an application-scoped CFC within a method is poor practice.
    Adam

  • Best Practices for sharing media with iMovie and FCPX

    So I've a large iMovie Events directory, and would like to use that media with both iMovie and FCPX projects.
    I'd rather not duplicate the media, so would prefer to import as references into FCPX.
    The dilemma is that I see that it's possible to modify or move media from within the iMovie application, and therefore break the reference to that media with FCPX.
    I only see two options:  (1) Never Ever modify the location/name of media in the iMovie Events file (even from within the iMovie app) since I would break an FCPX link if that media is referenced, or (2) always import (copy) the iMovie events into the FCPX Event Library making an independent original so that I can confidently operate on those media files in either application.
    I'd surely rather not have to do (2 )(e.g. doubling my storage demands) to gain the flexibility of using either application to edit the video, but really don't want to live with the restrictions of (1).
    Thoughts / Solutions?  What might you consider as options or best practices?

    Unless there is some other reason, users should own the right to share their mailboxes - it shouldn't be something that demands administrator management (if only so that the administrators aren't swamped by user requests for sharing their mailboxes). 
    For true shared mailboxes, when the mailbox is created, full access is granted by an administrator.

  • Best practice for calling stored procedures as target

    The scenario is this:
    1) Source is from a file or oracle table
    2) Target will always be oracle pl/sql stored procedures which do the insert or update (APIs).
    3) Each failure from the stored procedure must log an error so the user can re-submit the corrected file for those error records
    There is no option to create an E$ table, since there is no control option for the flow around procedures.
    Is there a best practice around moving data into Oracle via procedures? In Oracle EBS, many of the interfaces are pure stored procs and not batch interface tables. I am concerned that I must build dozens of custom error tables around these apis. Then it feels like it would be easier to just write pl/sql batch jobs and schedule with concurrent manager in EBS (skip ODI completely). In that case, one could write to the concurrent manager log and the user could view the errors and correct.
    I can get a simple procedure to work in ODI where the source is the SQL, and the target is the pl/sql call to the stored proc in the database. It loops through every row in the sql source and calls the pl/sql code.
    But I can not see how to set which rows have failed and which table would log errors to begin with.
    Thank you,
    Erik

    Hi Erik,
    Please, take a look in these posts:
    http://odiexperts.com/?p=666
    http://odiexperts.com/?p=742
    They could help you in a way to solve your problem.
    I already used it to call Oracle EBS API's and worked pretty well.
    I believe that an IKM could be build to automate all the work but I never stopped to try...
    Does it help you?
    Cezar Santos
    http://odiexperts.com

  • Best practice for using App Module Interface vs Impl

    Hello all,
    I understand the benefit and desire to use an Application Module via an Interface vs directly using the Implementation (Impl) class. This works fine for custom methods exposed on the interface, however, it does not address getters for view objects that are in the data model. Similarly, if I do use the Impl class, it returns a View Object Implementation - same issue here.
    Any thoughts?
    John

    Hi John,
    you can write custom method returning ViewObject class.
        /**Container's getter for DeptView1
        public DeptViewImpl getDeptView() {
            return (DeptViewImpl)findViewObject("DeptView");
        // This method can be exposed to client
        public ViewObject getDepts() {
            return getDeptView1();
        }When your view object will have custom method exposed to client then getDepts() method can return DeptView interface.
    Method returning impl class cannot be exposed as it probably doesn't follow rules (some rules are described in documentation - ch. 8.4.4).
    Or you can create your own interface and implement it in view object impl class. Getter returning this interface can be exposed to client.
    We found it very useful to use own java interfaces in our project. You can then create common logic working with any view object implementing specific interface.
    Rado

  • Best Practice for Enterprise Application Integration

    I would like to integrate a few corporate systems together by using Oracle Fusion Middleware. I suppose the integrated process is running in synchronous mode such that it also supports two phase commit.
    In BPEL Process manager, there is a tool called "WSIF" which seems to be relevant to my requirement. I would like to know which tools should be best for my integration project and any suggestion on implementation.
    Thanks in advance,
    Samuel Wai

    This has been answered repeatedly. WL allows you to cache JNDI context
              objects, ejb homes and remotes without any problems. (EJB remote interfaces
              must only be used by one thread at a time, but that requirement is provided
              by the EJB spec itself.)
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com
              +1.617.623.5782
              WebLogic Consulting Available
              "Geordie" <[email protected]> wrote in message
              news:3af9579f$[email protected]..
              >
              > I'm wondering what the best practice is for Servlet EJB integration in
              terms of
              > caching the home and remote objects. My understanding is that the Home
              object
              > is threadsafe and could therefore be cached as an attribute of the
              Servlet. This
              > would remove the need for a JNDI lookup for each request. Similarly
              caching the
              > ProxyObject would yield further savings. However, I have noticed that
              most examples
              > don't use either of these practices. Why not?
              >
              > Thanks in advance,
              > Geordie
              

  • Best practices for using Normalizer in ASA and in AIP-SSM

    Both PIX OS 7.x and IPS 5.x software have a concept of "traffic normalization". PIX OS on ASA can do virtual reassembly, IPS on SSM (so far as I know) can do physical reassembly and fragmentation of IP packets. Also, both ASA and SSM can do TCP normalization. For example, they both can "check inconsistent retransmissions" and protect against "TTL evasion attacks". I realize that PIX OS has only basic normalization functions and the SSM is much more configurable.
    The question is: what are the best practices here? Is it better to disable some IP/TCP PIX OS checks / IPS signatures on ASA and/or SSM? Is it better to use just SSM for traffic normalization? Does anybody has personal experience here?
    Also, there is a BugID CSCsd04327 - "ASA all out of order packets are dropped when sending to ssm"
    "When ips ssm is inline slowness is reported. show service-policy shows that the number of out of order packets reported match exactly the number of no buffer drops (even with queue-limit option). Performance hit is not the result of tcp normalization (on IPS 5.x ssm) in this case, but rather an issue with asa normalizer."
    To me it seems to be more logical to have normalization function on the firewall, but there may be drawbacks in doing this.
    So, those who're using ASA with SSM, please share your experience.
    Thx.

    Yes, this is almost correct ;)
    TCP SRP (Stream Reassemly Processor) is turned OFF on the SSM and cannot be enabled, contrary to 4200 appliances, but IP FRP (Fragmentation Reassembly Processor) is functioning on the SSM.
    The testing of 7.2(1) shows the following:
    When you configure "policy-map" to send packets to the SSM the "tcp-map" parameter "queue-limit", which has the value of zero by default, is set to an X (the X is unknown). This means that the ASA now only accepts the TCP segments which are sent in the correct order. More specifically, the gaps in SEQs are not allowed anymore. When for example, the ASA receives a TCP segment which has a SEQ within the window, but the previous TCP segment has been lost, it sends an ACK to the sender to enforce retransmition of the lost segment. As a result the sender retransmits both segments. Only after that the ASA forwards both segments to the SSM. This basically means that SSM always sees in-order TCP segments. That it is why SRP is not needed on the SSM.
    There are at least two problems however.
    The first problem is the performance impact.
    ASA now acts almost like a proxy. And, so far as I know, it doesn't support SACK (Selective ACKs). First, when the ASA does TCP SEQ randomization it doesn't change SEQ values within the SACK TCP Option. This simply breakes SACK. Second, even if you turn randomization mechanism OFF, then, I believe, the ASA will not selectively ACK the lost TCP segments, as it simply doesn't support this mechanism.
    The second problem is THE SECURITY HOLE.
    By default the ASA doesn't check TCP checksums. The 4200 appliances do check by default. But as we now know the SRP is turned OFF on the SSM... So, this means that SSM module can easily be evaded. The hacker only needs to mix attacking traffic with the random TCP segments that have bad TCP checksum. The SSM module will see the mixture of the two and will not recognize the attack. The target host will drop TCP segments with the bad checksums and see only attacking traffic... This has been successfully verified in the lab.
    Of course, this security hole can be closed with the "tcp-map" parameter "checksum-verification", but it will definitely has performance impact.
    The last note: All of the above has never been documented by Cisco. So, use at your own risk, etc.
    I hope, you will read this message, Marcoa. All of this MUST be documented. Once again, the default behaviour of the ASA opens up a big security hole.
    Regards,
    Oleg Tipisov,
    REDCENTER,
    Moscow

  • Best practices for creating application schema

    All,
    Can anyone recommend best practices (or pointer to a url) for creating application schema. A novice installer created a schema and the tablespace ran out of disk space in 2 days and the system came to a halt at a production site. The tablespace was created with one datafile and with MAXSIZE specified. I am looking for Do's and Dont's on production system.
    Thanks for any help,
    Vissu

    I'm not sure that you can boil this down to a "Do's and Don'ts" list unless you want to get overly general...
    For example, do make sure that you provision space appropriately. "Appropriately" however, is going to be radically different in different environments. Some shops set all their data files to autoextend in production and monitor utilization at the OS level. Other shops specify exact file sizes and monitor utilization at the Oracle level. Each approach has its own advantages and disadvantages, you just need to make sure that your application uses the same approach that every other application in the organization uses.
    Do have an idea about the space utilization of the application, but don't go overboard. Running out of space in 2 days means someone failed to do a basic analysis. On the other hand, I've seen people spend way more time than they should making 5 year projections based on some relatively soft assumptions and getting worried about internal overheads that were much smaller than the error bars in their baseline estimates. Of course, the precision necessary also depends on the implications-- a 20% error in a multi-TB data warehouse is going to have a lot more impact than a 20% error in a 20 GB OLTP application.
    Justin

  • Call Application Module method(Function) from maanged bean

    Hi Experts,
    JDEV 11.1.2
    I created method in application module which access two parameters and returns a string value, then binded in pagedefinition file as method action.
    Now i wisht to call from a managed bean by passing two parameters , give me a sample code of it..
    Thankz in advance
    PMS
    Edited by: pms on Feb 18, 2012 11:56 AM

    am code
    public void checkLoginCredentials(String ename,String pwd_form)
    System.out.println(ename + " " + pwd_form);
    EmpLoginViewObjImpl vo = (EmpLoginViewObjImpl)getEmpLoginViewObj1();
    //set the bind variable value to last name
    vo.setNamedWhereClauseParam("LastName",pwd_form);
    vo.executeQuery();
    int rowCount=vo.getEstimatedRangePageCount();
    System.out.println("rowCount="+rowCount);
    if(rowCount==0) {
    throw new JboException("Password doesn't match");
    bean code
    public String commandButton_action() ()
    String returnStr="error";
    System.out.println("Inside loginBtn_action");
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding =
    bindings.getOperationBinding("checkLoginCredentails");
    Object result = operationBinding.execute();
    System.out.println(result);
    if (operationBinding.getErrors().isEmpty()) {
    returnStr= "success";
    System.out.println("returnStr= " + returnStr);
    return returnStr;
    }

Maybe you are looking for

  • Lync 2013 vdi RDS windows 2008R2

    Hi, I have installed VDI on win2008R2 server with RDS make all configuration and it Works fine. I have Win7 RDP installed VDI and updateted all RDP. I have USB WEBCAM and I configured remoteFx to use USB webcam and it Works with Win2008R2 RDS audio a

  • Data source for SQR reporting

    Is it possible to use the Brio Query or Report Results as a data source for an SQR report? Instead of accessing a database for an SQR, can I use the Results section instead?

  • Xorg hard Freezes using Intel Video Driver

    I have an Intel GMA 945 graphic card and randomly my system freeze. I can't do alt+pet+reisub. I have to reset manually. When I play mupenplus and i load conker rom always crashes. I have these errors on dmesg. X:6797 conflicting memory types d000000

  • Deleting duplicates in iphoto '09

    Is there a simple way to delete all duplicate photos

  • Safari, iPhoto & iCal not finding Mail

    For some strange reason Safari cannot "see" Mail to "send a link" or "contents" of a web page. I get a message saying that I meed to install Mail first. In iPhoto the button to "email" a picture is generic (grey oblong and not iconic) and now only as