Batch application: As EJB or standalone?

Hi,
We are trying to develop some batch applications using java language.
I was asked to evaluate the differences between running them as standalone java programs or as an EJB inside an Application Server.
Any idea? Which is the best way?

Good question. I'm currently in a similar planning process (I'm still in a pretty early stage), and so far, I've come up with the following notes:
pro non-ejb:
- on EJB you cannot have multiple threads for a single EJB
- File I/O is also restricted on EJB
pro ejb:
- location transparency; you can basically run it everywhere
- on app server, possibility of ressource sharing (e.g. JDBC connection pooling)
misc:
- future ejb specs might contain timers (schedulers) so that you can schedule the jobs without programming the scheduler; not available at the moment in general, although some vendors might support this (weblogic ??)

Similar Messages

  • Batch processing: As EJB or standalone?

    Hi,
    We are trying to develop some batch applications using java language.
    I was asked to evaluate the differences between running them as standalone java programs or as an EJB inside an Application Server.
    Any idea? Which is the best way?

    If you are running the EJB's and the client calling them within the same application server and it is a non-idiotic EJB container, then the overhead of calling an EJB is on the level of a method call plus some hashtable lookups or the like for turning the symbolic name for the EJB into a java reference to an instance.
    If your system is large enough that you have to spread the load of running the EJBs over several machines you will benefit from the facilities for controlling and administering such a setup that the appliaction server provides you with.
    Building your own system will not only cost a lot of time and effort and end up offereng less functionality than the J2EE server due to your development budget being orders of magnitude smaller than SUN's, you will also have a hard time making a better performing system since you have the same facilities at your disposal for creating your system as SUN had when creating J2EE.
    The only exception is if your task is very unlike what J2EE was constructed for handling well so you will be creating a radically different architecture than J2EE. From what little you have told about your task, it seems to fit nicely within the range os tasks J2EE was ment to handle well.

  • Ejb in standalone application

    hello
    does anybody know how to make a standalone application, with ejb classes as domainobjects, run?
    currently i keep on getting the same error:
    Exception in thread "main" java.lang.IllegalArgumentException: Unknown entity bean class: class be.roularta.scenario.domain.Definition, please verify
    that this class has been marked with the @Entity annotation.
            at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerImpl.findInternal(EntityManagerImpl.java:266)java version is 1.5.0
    can anybody help me ?

    Hi Martin,
    I am trying to do something similar and got the same exception.
    java.lang.ClassCastException
         at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
         at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
         at com.sap.ip.bi.sdk.datasource.beans.TestJ2EE.getSystems(TestJ2EE.java:124)
         at com.sap.ip.bi.sdk.datasource.beans.TestJ2EE.<init>(TestJ2EE.java:67)
         at com.sap.ip.bi.sdk.datasource.beans.TestJ2EE.main(TestJ2EE.java:146)
    The code snippet:
    Properties props = new Properties();
              props.put(Context.INITIAL_CONTEXT_FACTORY,
                        "com.sap.engine.services.jndi.InitialContextFactoryImpl");
              props.put(Context.PROVIDER_URL, "localhost:50004");
              props.put(Context.SECURITY_PRINCIPAL, "Administrator");
              props.put(Context.SECURITY_CREDENTIALS, "");
              try {
                   Context ctx = new InitialContext(props);
                   Object obj = ctx.lookup("BI_SDK_CAF");
                   IBI_CAF_Home boxHome = (IBI_CAF_Home) PortableRemoteObject.narrow(obj,
                             IBI_CAF_Home.class);
                   BI_CAF_Bean bean = (BI_CAF_Bean) boxHome.create();
              } catch (Exception e1) {
                   // TODO Auto-generated catch block
                   e1.printStackTrace();
    I tried doing the "get client jar" and putting it in the classpath but that did not work.
    Am I missing something else?
    Regards,
    Anweas

  • How can I develop a web application using EJB design pattern?

    I have searched over the web and found quite a lot of tutorials on how to use the EJB design pattern.
    I know that there will be a home interface, EJB object interface and a SessionBean.
    But the tutorials often only cover a single class, this made me unable to get a complete picture of how EJB design pattern can be implemented into a whole system.
    I am now required to devleop an online shopping web application using EJB and JSP page.
    I think I will need to create a lot of classes: Member, ShoppingCart, Product...etc.
    What I want to ask is that, do I need to create a home interface, EJB object interface and a SessionBean for each of these classes?
    I really need some ideas on how to develop this system using EJB + JSP pages.
    Many thanks to you all.

    For every EJB that you want to create, you will need to code a home and remote interface and a bean class.
    You could start getting your ideas here
    http://www.theserverside.com/books/wiley/masteringEJB/
    http://www.coreservlets.com

  • How to write to an XML file from JDE batch application?

    Hello everyone,
    I need to write data from a batch application to an XML file. I don't know how to use the XML business functions.
    I tried to use XML Publisher but the format is not the same as the client XML. The XML file has some customized format.
    I need to do it manually with business functions and ER. Please help me out.
    Some business functions I saw are Create XML document, XML Add element and XML Add attribute but the parameters are complex to
    use.
    Thank you very much.
    Edited by: Lovvy on Sep 8, 2010 2:58 AM

    The XML DB forum is better suited to your question.
    It also has a FAQ which details how to read and shred XML into tables as well as other common XML based questions...
    XML DB FAQ

  • Hibernate/IBatis/JPA for batch applications

    We are planning on developing a batch application. Performace is a very critical part in this. Wanted to get some feed back upon which is the best framework for batch applications.
    This application would not have too many inserts/updates. It will have selects mainly.
    Can somebody suggest which framework is good Hibernate/Ibatis/JPA ?
    Thanks in advance
    Gautam

    Uppalapati wrote:
    duffymo wrote:
    "batch" usually means "transactional" to me. Why would a batch be mainly SELECTs? Makes no sense.
    Most people wouldn't use Java/JDBC for batch. Better to use the tools that are optimized for your relational database in most cases.
    sorry by stating that a little unclear. It is basically a stand-alone application. It reads messages as they comeby and process the messages. The processing of the messages require a lot of validations to be done (which are dependent upon a lot of parameters in the database and these would require selects). and finally based upon a few criteria's we write the data to the database. Are the validations static, read-only reference data? If so, you can read it once and cache it. Unless the SELECTs are truly dynamic and need to be made every time, perhaps you can save yourself some network traffic that way.
    Caching with Hibernate might make a difference, depending on how dynamic the validations are.
    and my reason for stating that it would have lots of selects is for the validation purpose and some inserts for updating the status.
    duffymo wrote:
    JPA and Hibernate will both require that you have an object model to map to your schema. Do you have that? If not, don't use either of those.
    I have an object model to map with and which is the reason why we are considering Hibernate/Jpa.OK, that's better.
    Either one will do, then. The advantage of JPA is that you don't have to commit to Hibernate, since TopLink and JDO will do as well. You can also use Glassfish or any other Java EE app server that supports EJB3 as well.
    How well do you know Hibernate and/or JPA? The other consideration is your level of skill. Choose the one you know best. Assess the risk if you're just learning and this is a critical project.
    Do you know that JDBC itself can't do the job?
    What other reasons do you have for going this way?
    %

  • GUI for batch application

    hi all,
    I have a batch application that, when running, receive command and send response from DOS console.
    I would like to create a GUI that interface my batch application,send command, receive response...
    Anyone have suggestion or semples?
    Thanks!

    I am not sure what is your exact concern.
    Separation into Model-View-Controller (MVC) is what you want.
    Start with the console application. You can simply make 3 packages (model, view, controller), and start with a System.out, System.in app.
    Then create new packages guiview and guicontroller and implement your Swing app there.
    The model should be unchanged.
    The controller should be readable and easily migrated.
    Runtime.exec(...) might provide your access to DOS.

  • Using log4j to create custom log level in standalone batch application

    Hi all,
    I would like to use Log4j to create a custom log level so that from my standalone java batch process application, whatever error messages I can log to a log file.
    Can any one give me any pointer on this.
    Appreciate any help.

    This doesn't seem to warrant a 'custom level'. Just use Log4J as is... create a Logger object and use its error() or warn() or whatever methods are appropriate for the logging you want to do. I don't understand the reason for the question.

  • Pagelets not rendering in Fusion ADF application pages deployed on standalone weblogic server

    HI All,
    I am creating a Pagelet Producer connection, and dragging a pagelet on the page as iframe, with height auto. When I run the application in the integrated weblogic server, I am able to see the pagelet. However when I deploy the application on the standalone weblogic server, then the pagelet isn't rendered.
    I am using fusion ADF application 11.1.1.7  and standalone weblogic server v 10.3.6.
    Thanks in advance for yours assistance. Please I need a solution for this uregently. DO let me know, if you need any additonal information.
    Regards,
    Nikhil Mahto

    Sorry for the wrong infromation. The correct scenario is:
    I have an ADF application, in which I have a Pagelet producer connection, pages and taskflows. This ADF application is inlcuded in a Webcenter Portal Framework application, as a shared library. When the WCF application is deployed on the Weblogic server, the pagelets don't appear on the pages.
    I tried the FRAMEBUSTING context parameter to never but it didn't help.
    Regards,
    Nikhil Mahto

  • How to convert batch application to server app?

    I have an application that performs some processing task in batch mode: data in, processing, data out. The application can be accessed through a well-documented API but is not thread-safe -- one cannot run the processing function in two threads concurrently.
    In order to make that processing accessible to a program written in another language I would like to encapsulate it into some form of server.
    I would like to find some minimum overhead solution where the other program sends the data to the server app in some way, waits for the processing to complete and reads back the result. One option would be to use the HTTP protocol with a POST request, another to write the data to a database row and send some command over a socket.
    My main problem is: which solution is the easiest to implement and use and the one that allows to serialize the processing with the least effort. The solution should make it easy to prevent deadlocks or similar nuisances.
    Are there some standard patterns for doing this or what would you Wizards recommend?

    Thanks for the answers!
    I must admit that I am still rather clueless in general about the issues involved here.
    My immediate need is to send text files to the java application and get back processed text files. At the moment I have to do this from perl, but in the future, other languages (mostly scripting languages) might also need to do this.
    So what I am trying to achieve is this: the client should be able to access the Java application/service as if it was some synchronous write/read operation (similar to a HTTP post request waiting for a response). There might be several clients working in that way but the the server should make sure that they get cleanly serialised: only one text file can be processed at any one time because the API is not thread safe.
    I also cannot change the API itself -- just wrap into something that will do what I described. The more lightweight,easy to use, and easy to implement the solution the better.
    For example, is there some kind of mini HTTP server and some serialization mechanism in Java that would make it possible to run the Java application disguised as a web service? Are there disadvantages to this and other solutions that are more suited?
    I have looked at JMS and it does make a bit of a heavyweight impression to me. Also I'd prefer a solution where the clients use some mechanism that is more general, e.g. HTTP or the file system or maybe even a RDBS table (not sure what the possible traps with regards to deadlocks, timeouts etc. are there).

  • Batch Applications in Java

    I have to write programs in Java which will run as a nightly process (same as COBOL in mainframe) without any user inputs. First question is: Is it a good idea to do this. Eg: I will give an example of a real life situation. Let us take a banking application. Every night after the bank is closed the system has to spin through every checking accounts (millions) and do some transactions, cleanups maintenenace so that next day when the bank is up and running the accounts are ready. Normally these kind of processes will be in COBOL. Please give me input and will appreciate your ideas. Is it better to do this in C++ ??? :)
    Thanks

    * Java as many libs useful for batch (like XML APi, JMail, log4j etc ...)
    * you can do a "big" program that execute some tasks depending on args. A part of your code is common. With several batch you have to duplicate it.
    * if your batch are very different and don't use same code, no need to do a program.
    * the use of Java is platform independent, so if your server change, no need to recompil the code !
    * java is an Oriented Object Language, so if you don't have an Object Model ...
    * if all your other program of your Information System is in Java why not keep it heterogen ?
    * shell script is faster than java if you know use it !
    it depend on project, I use a java program to do my batch because all my architecture is in java and because i need send/receive mail, acces ftp/http and i use an object model to generate report etc ... but if you just want to write a csv file from your database you don't need to use other thing than shell script .
    think about global architecture, future of your application ... good luck !

  • How can i test my web applications SWF in the standalone player?

    I have been using flash builder for a bit, and i love it!, but i don't want to test webb applications in my browser, i want to be able to launch them in the standalone player or debugger. After numberous google searches, it seems my flash builder IDE has something wrong with it, ( Even after re-installing it ) because when i try to make a new launch configuration, it doesn't have a field to accept a run or debug path. only a path for the html file used in the browser. This conflicts with all of the adobe help posts . I'm stuck here. can anyone help? thanks.

    I would avoid using <center> tags, they're deprecated (http://www.w3schools.com/TAGS/tag_center.asp)
    instead I would do something like
    <div style="margin: 0px auto 0px auto; width: 800px;"></div>
    put your content inside that div and it should be centered. Set the width to whatever you want.

  • Logging Standards and ADF Application Log File on Standalone WLS

    Hi Experts,
    I am using JDev - 11.1.1.5.0 and WLS - 10.3
    Is ADF Logger the standard logger to be used in an ADF Application? If Yes, how to configure it?
    During development I simply used "System.out.println" for log messages and I was able to see the log messages in the Integrated WLS Console in JDeveloper. Now, I am moving to deployment on Standalone WLS. Please let me know how to configure the logger to log these messages to some log file to be accessed from standalone WLS.
    Thanks
    Rathnam

    Start with this 5 part series http://blogs.oracle.com/groundside/entry/adventures_in_adf_logging_part
    http://blogs.oracle.com/groundside/entry/adventures_in_adf_logging_part1
    http://blogs.oracle.com/groundside/entry/adventures_in_adf_logging_part2
    http://blogs.oracle.com/groundside/entry/adventures_in_adf_logging_part3
    http://blogs.oracle.com/groundside/entry/adventures_in_adf_logging_part4
    For the UI
    http://blogs.oracle.com/jdevotnharvest/entry/using_adf_logger_with_groovy
    and For some more advanced usage
    http://tompeez.wordpress.com/2011/09/23/adflogger-using-a-custom-formatter-class-to-print-log-messages/
    Timo

  • J2EE Application works on OC4J standalone but not Oracle 9iAS

    I have a J2EE application that works successfully on OC4J 9.0.3, but not when deployed on Oracle 9iAS 9.0.3.
    The platform in Win2K
    What I am seeing is certain POST requests are sent to the server, call an EJB, update the database, and return a JSP, but sometimes, only half the response is seen by the browser, along with a TCP RST packet, which is why the response is not seen by the browswer.
    I think this could be a bug in the Oracle HTTP server. Has anyone seen a similar problem? Are there any solutions, other than throwing away 9iAS and using a different appserver? AFAIK, it is not possible to apply any patches to the Oracle HTTP Server without losing support. Is this correct?

    Hi Andrew,
    Are there any solutions, other than throwing away 9iAS
    and using a different appserver?As far as I know, OC4J stand-alone is a (J2EE compliant) application server, and an officially supported Oracle product. So maybe just throw away "iAS" and use OC4J ;-)
    For your information, OC4J can be used with the Apache Web server. Visit the OrionSupport Web site for details.
    Good Luck,
    Avi.

  • Unable to load batch loader(UCM) in a standalone mode.

    Hi
    I have installed webcenter content 11g, and I am able to open administration application through admin applet. However I am unable to start "BATCH LOADER" from UCM installed directory(i.e., in the path bin/BatchLoader).
    When i double click "BatchLoader" it is giving me an error message "*Unable to start the batch loader. Failed to initialize. !apSchemaObjectExists_Field, xiPMSYS_STATUS The field 'xlPMSYS_STATUS' already exists*". I set database information correctly in system properties.
    Please help.
    Regards
    Raj

    should anyone else have this problem ... it turns out I needed to upgrade PanoPlayer

Maybe you are looking for