POJOs or EJBs for worker classes spawned from Application Module?

Hello,
I'm running JDev 11.1.2.3.0.
I need to create a couple of worker classes that will be instantiated from my Application Module. The first will invoke PL/SQL via createCallableStatement. The second sends a message to a jabber server.
In the Java EE world, I'd do this with stateless EJBs and use the @PreConstruct and @PostDestroy annotations to control the lifecycle.
What is the recommended approach with ADF when using Classes to make these calls from an Application Module? Should one use POJOs and rely on WebLogic to handle garbage collection, or should/can one use EJB 3.0 stateless session beans?
Many thanks.
Edited by: user576183 on May 11, 2013 9:24 AM

Stateless session beans is the recommended approach with ADF BC too.
http://docs.oracle.com/cd/E14571_01/web.1111/b31974/bcextservices.htm
http://technology.amis.nl/2013/01/20/adf-interaction-with-business-service-an-ongoing-discussion/

Similar Messages

  • Call VO method from application module

    Hi Experts.
    In my case I have created VO and inside implementation class custom method: filterResultsByGroup()
    code:
    public class VO_Business_AreaImpl extends ViewObjectImpl implements VO_Business_Area {
    public VO_Business_AreaImpl() {
    public void filterResultsByGroup() {
    System.out.println("hello");
    now... I would like to call filterResultsByGroup() method from Application Module Imp class:
    code:
    public class AppModuleImpl extends ApplicationModuleImpl implements AppModule {
    public AppModuleImpl() {
    public VO_Business_AreaImpl getVO_Business_Area1() {
    return (VO_Business_AreaImpl)findViewObject("VO_Business_Area1");
    public void RunGroupFilter(){
    ViewObjectImpl bussinesArea;
    bussinesArea = this.getVO_Business_Area1();
    ViewCriteria vc = bussinesArea.getViewCriteria("filterResultsByGroup();");
    bussinesArea.applyViewCriteria(vc);
    bussinesArea.executeQuery();
    but it doesn't work. Anyone knows how to call this method?
    Best Regards.

    you code should be like
    VO_Business_AreaImpl bussinesArea;
    bussinesArea = this.getVO_Business_Area1();
    bussinesArea.filterResultsByGroup();

  • PL/SQL from Application Module instead of Using VO/EO - Violating Standard?

    Hi,
    I have seen product code which Use PL/SQL APIs for committing data (Creation of Records in Table) from Application Module. There is no BC4J (VO/EO) used in this data route.
    Is there any coding standard (document) which says such cases are against Standards.I know there is one Standard saying PL/SQL Based VO is dicouraged in Oracle Apps.
    Thanks
    Joseph

    Vikram,
    Performance depends on the way you are going to make use of pl/sql code. Suppose if you are using pl/sql just for final insert/update with other validations bound to it through a single call, that's fine. But in case you have other multiple calls to pl/sql blocks also for fetching data for display purpose, that's where standard VO's will be more efficient reducing the number of trip for pl/sql calls. So use it only when it is the last way and you need to handle multiple validations with complex data structure.
    As for locking, yes, you might have to take care of locking handling scenario if such a situation happens. But again it depends on what's your business logic and how is your data being processed.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • API for Work Order status from Released to Unreleased or any user defined s

    Dear All
    Is there any API for to change work order status from Released to Unreleased or any user defined status.
    Take care
    Aamir

    Hi Ben,
    As query is resolved, you should close the Thread after rewarding to the Concerned
    Thanks,
    Manish

  • Ejb jars not being read from application.xml

    Hello. If somebody wouldn't mind reading this, I've been wrestling wiht this most of the day. I have a coupe of entity ejbs and a stateless session ejb, each packed into it's own jar. When I deploy the ear, the war deploys fine but the three ejb jar files are not read as per the application.xml. As a test, I put the jars into the default server lib directory and after I did that, the enterpise app launched as expected. I can't figure out why the server, resin 3.0.12, is not able to see these ejb jars. I've tried to add the directory after deployment to the classpath in the autoexec.bat but no dice. I've moved the ejb jars around into subdirectories and modified the application.xml accordingly but to no avail. I've also looked into the server configuration file but resin doesn't seem to have any taggings within it's ejb server tag that would dictate where the container would look for jar or class files. Does anybody have any ideas what this could be?...this is the application.xml...pretty straightforward...the ejb jars are located in the root of the ear...
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE web-app (View Source for full doctype...)>
    - <application>
    <display-name>MyApp</display-name>
    - <module>
    <ejb>cn.jar</ejb>
    </module>
    - <module>
    <ejb>cnf.jar</ejb>
    </module>
    - <module>
    <ejb>cni.jar</ejb>
    </module>
    - <module>
    - <web>
    <web-uri>nctims.war</web-uri>
    <context-root>/nctims</context-root>
    </web>
    </module>
    </application>
    Thank you very much for taking your time to read my post.

    Hello. Thank you very much for the reply.
    Yeah, application.xml is sitting in META-INF. The war referenced wihtin application.xml deploys fine...the container jsut seems to ignore the <module><ejb>..</ejb></module> tags when it reads the ejb deployment descriptors and tries to locate the classes. I've tried everything...shouldn't application.xml take care of all class-loader issues with the module references? Thank you again to everybody reading this or whatever.

  • Any new ideas for launching web browser from application

    I have searched the forums trying to find a new way of launching a web browser from a java application. The problem I am having is that on Unix and Linux systems, at least the variety I have access to (not quite sure on what that variety those are as they are not my systems or systems I control), the common method of using Runtime.getRuntime().exec(STRING) with either netscape or mozilla does not work. While using the Runtime.exec method is not the same as a console, I did try on these systems "netscape + A_WEB_ADDRESS" (or mozilla) and it did launch the respective browser with the page, so it appears that at least from the console level, those commands are valid.
    All the forums seem to say that the Runtime.exec method is the way to go. All the source code I have found through links from the forum say the same thing. I have voted on this bug:
    http://developer.java.sun.com/developer/bugParade/bugs/4210168.html
    and the feedback there does seem to indicate that there is similar trouble out there. Below is the code I am using. It does work on Win2000,XP, and Mac OSX. The application is not supported on earlier systems, and as it stands it will not work on Win 95,98, nor ME. Only small modification should be needed for work on those OSs, but as I no longer personally use those OSs, I cannot be sure.
    private void openNativeBrowser(String url) {
    // not the browser itself is started, i only call something like
    // start http://www.javasoft.com
    // and then the standardbrowser will be started ...
    StringBuffer call = new StringBuffer();
    System.err.println(System.getProperty("os.name"));
    System.err.println(System.getProperty("user.dir"));
    try {
    // which OS ?
    String operatingSystem = System.getProperty("os.name");
    // how to call the OS
    if (operatingSystem.toLowerCase().indexOf("windows") > -1)
    call.append("cmd /c start ").append(url);
    else
    if (operatingSystem.toLowerCase().indexOf("mac") > -1)
    call.append("open ").append(url + " &");
    else if(operatingSystem.toLowerCase().indexOf("linux") > -1)
    // use Script 'netscape'
    call.append("mozilla ").append(url).append(" &");
    else
    call.append("netscape ").append(url).append(" &");
    System.err.println(call.toString());
    // start it ...
    Runtime.getRuntime().exec(call.toString());
    catch (Exception e) {
    System.out.println(e.getMessage());
    e.printStackTrace();
    As I said, if you have a new way to call the broswer that seems to work on either Unix or Linux, please post it, point to it, or explain it.
    Aaron

    there is a shell script on Linux called htmlview that you can launch like this:
    String[] cmd = {"htmlview", "http://java.sun.com"};
    try {
        Runtime.getRuntime().exec(cmd);
    } catch (IOException ioe) {
        // do something
    }which will open the default browser. Don't think this is available on other *NIX though, although the script itself would probably work so you could include it with your app (/usr/bin/htmlview).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Error while calling webservice from application module

    Hi all
    I have generated a Proxy from a web Service and i am trying to call the web service from an Application Module it is throwing me error
    JBO-29000: Unexpected exception caught: oracle.classloader.util.AnnotatedNoClassDefFoundError, msg= Missing class: webservices.types.com.siebel.xml.order_interface.Orders Dependent class: java.lang.reflect.Array Loader: jre.bootstrap Code-Source: unknown Configuration: jre bootstrap
    Missing class: webservices.types.com.siebel.xml.order_interface.Orders Dependent class: java.lang.reflect.Array Loader: jre.bootstrap Code-Source: unknown Configuration: jre bootstrap
    My web Service is correct, as i have executed the client and it is working fine, but when i try to access the web service from an application module it is throwing me this error. So any light on this issue will be very helpful
    thanks

    This forum is for XML DB issues. XML DB is a feature of 9iR2 and later.You need t look in the XML Technology forum

  • BC4J: How get Connection from Application Module

    I've written a custom method for my Application Module for using by the client tier. In this method I call a JPUblisher created class, that accesses a PL/SQL procedure. For this JPublisher created class I need a connection context. The class calls DefaultContext.getDefaultContext() but that seems to be null.
    How can I get the current Connection of the Application Module, so that I can create a DefaultContext?
    Unfortunately Transaction has no getConnection method.
    Thanks,
    Robert

    We don't make the Connection directly available because in some sense it's a rope on which you can hang yourself if you are not careful. Since BC4J AppModules are most often used from a pool, and you might be using connection pooling in addition to application module pooling, in general it is not safe to get hold of the raw JDBC connection and "hang onto it".
    If you make careful use to always get the current JDBC connection before you use it, and not try to cache it, then you should be ok. Often, you can avoid the need to get the raw JDBC connection by calling getDBTransaction().createPreparedStatement(...) or the analogous createCallableStatement() or createStatement() that are also on the DBTransaction interface.
    Here is a little function you can add to your application module impl class to retrieve the Connection:
      private Connection getCurrentConnection() {
        Statement st = null;
        try {
          st = getDBTransaction().createStatement(0);
          return st.getConnection();
        catch (SQLException s) {
          s.printStackTrace();
          return null;
        finally {
          if (st != null) try { st.close(); } catch (SQLException s2) {}
      }It basically creates a (dummy) statement, gets the current connection from the statement, then closes the statement.
    I tried using this in a custom method in an AppModuleImpl class that invoked a JPublisher-create package-wrapper class like this:
      public void callStoredProc() {
        try {
          // Empservice is package wrapper class created by JPublisher
          Empservice e = new Empservice(getCurrentConnection());
          BigDecimal sal = e.lookupsalary(new BigDecimal(7369));
          System.out.println(sal);
        catch (SQLException s) {
          s.printStackTrace();
      }and it works for me.

  • Obteain connection object from application module

    Hello
    I am working with ADF 10g using BC4j , I am in application module implementation class, how can I obtain the java.sql.connection object used by my application module?

    to execute prepared statements follow
    http://download-uk.oracle.com/docs/html/B25947_01/bcadvgen005.htm#sm0297
    to access the SQL connection itself (for whatever reason)
    Re: how to get connection from adf bc?
    Frank

  • Error While Calling a WebService from Application Module

    Hi all
    I have generated a Proxy from a web Service and i am trying to call the web service from an Application Module it is throwing me error
    JBO-29000: Unexpected exception caught: oracle.classloader.util.AnnotatedNoClassDefFoundError, msg= Missing class: webservices.types.com.siebel.xml.order_interface.Orders Dependent class: java.lang.reflect.Array Loader: jre.bootstrap Code-Source: unknown Configuration: jre bootstrap
    Missing class: webservices.types.com.siebel.xml.order_interface.Orders Dependent class: java.lang.reflect.Array Loader: jre.bootstrap Code-Source: unknown Configuration: jre bootstrap
    IMy web Service is correct, as i have executed the client and it is working fine, but when i try to class the web service from an external class or from an application module it is throwing me this error. So any light on this issue will be very helpful
    thanks

    Hi,
    did you registered the web service in the external service registration? The "DataAccessException:" is a hint to this issue.
    best regards,
    Rene

  • Obtaining DataSource from Application Module

    How may i obtain DataSource from pool managed by Application Module? I want some of my db-related operation performed by Spring's JdbcOperations class ( http://www.springframework.org/docs/api/org/springframework/jdbc/core/JdbcOperations.html ) and i want have only one connection pool in my application.
    Thanks,
    Kind regards,
    Marcin Zduniak / http://J2ME.pl

    Refer
    http://www.oracle.com/technology/products/jdev/howtos/10g/usingdatasources/using_datasources.html

  • Getting JNDI name from application module configuration

    How to programmatically get JNDI name of the data source, specified in the bc4j.xcfg, using application module object or oracle.jbo.client.Configuration, or whatever?

    im sorry for interupting this thread. i have a question for Vinay. Actually im watching this thread bcoz i too have the same question.
    Vinay, what imports is to be added for this.None, if you are using ADFbc.
    The method is available in your ApplicationModuleImpl (i.e. the Java Impl for your AM).
    Here's the 11.1.1.5 javadoc:
    http://docs.oracle.com/cd/E24001_01/apirefs.1111/e10653/oracle/jbo/client/remote/ApplicationModuleImpl.html#getSession__
    im using Jdev 11.1.1.5.0 the statement is : System.out.println("Data Source Name"+getSession().getEnvironment().get("JDBCDataSource"));
    Its showing getSession() method not found.
    Any help???Where did you write that statement? It should work in the AMImpl as the javadoc shows....

  • How to get value in backing bean from application module

    Hi all.. I'm new in jdeveloper and adf..
    I need to use value from backing bean and use that value in application module.
    But I don't know how to get it.
    Do you a have any solution?

    suppose you have myMethod(String argumentName1,String argumentName2) in your Application Module
    then to access a method binding from a managed bean, use the following code,
      BindingContext bctx = BindingContext.getCurrent();
      BindingContainer bindings = bctx.getCurrentBindingsEntry();
      OperationBinding operationBinding =
           bindings.getOperationBinding("name_of_method_binding");
      //Here you can pass the parameters value to the AM method
      operationBinding.getParamsMap().put("argumentName1",value1);
      operationBinding.getParamsMap().put("argumentName2",value2);
      //invoke method
      operationBinding.execute();
      if (!operationBinding.getErrors().isEmpty()) {
         //check errors
         List errors = operationBinding.getErrors();
      //optional
      Object methodReturnValue = operationBinding.getResult();

  • Connection object from application module

    hi
    i was wondering if there is someway to retrieve the Connection object from the application module. something like:
    java.sql.Connection conn = appMod.getConn();
    i'm using JDeveloper 9.0.3.4
    Thanks in advanced
    Vitor

    Take a look at
    http://radio.weblogs.com/0118231/2004/01/30.html#a232
    Sascha

  • Binding Methods Exposed From Application Module

    Hi All,
    I am using JDeveloper 11.0.2. I have a method exposed on the Application Module that when invoked, it creates a row. I exposed AppModADImpl as a client interface. After doing this, I am now able to see the method under data control section. On my page, I when to bindings and tried to create a bind to this method, I am able to see the method but the OPERATIONS list is disabled, because of this, I am unable to create the bind to the page.
    The method I'm trying to bind is below
    public Row createSystemTypes() {
    ViewObjectImpl vo = getAdSystemTypes1();
    Row row = vo.createRow();
    vo.insertRow(row);
    return row;
    Because the Operations List if disabled, when I click OK, I get the Error "No Actiond defined for the selected Item"
    I would appreciate help to know why Im unable to bind the method to the page.

    As the method has been added to the client interface of the application module, you have to select the application module in the dialog, not a view object. After selecting the application module (or the data control or root node) you should see all methods which are part of the client interface.
    Still, I wold do like Joonas outlined: use drag and drop and if you don't like the button you get this way on the page, switch to source mode and remove it. This will keep hte generated binding in the page def. Removing the button in design view will remove both, button and binding.
    Timo

Maybe you are looking for

  • Open Delivery Schedule list

    My current client wants to display a list of Open Delivery Schedules via ME3M or ME3N in ALV mode. using selection criteria WE101 or WE103. The problem is that these reports also display schedule lines that were already received.  I tried changing th

  • ITunes 8: I can no longer connect to remote speakers via Airport Express

    Cannot connect to my remote speakers, worked before iTunes 8" I have restarted the computer, iTunes, QT 7.5.5, run disk utility I get the following error code (-3256) Apple KB research says: AirTunes: Error -3256 when streaming to multiple AirPort Ex

  • Time Machine backup not appear

    Hi I bought a bigger HDD for MacBook Pro (so I could install VMs locally) and decided to test TM data restore as a procedure to migrate data. I wanted to keep using my MBP for work, but luckily we have a loan which i used as follows:- - Stuck in new

  • Phone screen is white all along the bottom

    I purchased a Blackberry curve 3G on contract on 10 December from Carphone Warehouse. This is only 3 weeks ago so within my 28 day warranty period. I picked up my phone this morning and noticed that the bottom right hand corner was white. To try to r

  • I'm very pleased

    Forums like this tend to be filled mostly with issues and complaints, so I thought I'd try inject a positive vibe here.... Though I did have a couple hurdles to overcome with my new iPod Touch, it is working very well for me, and I have very few comp