BC4J in OC4J Best Practice

What is the best way to deploy BC4J to OC4J?
Option 1:
Deploy the BC4J libraries either manually or via the bc4j2oc4j.bat script to OC4J root lib
Option 2:
Deploy the BC4J runtime libraries with each application deployed under OC4J
Currently I use Option 1 because I only have to add the BC4J files once, I get consistency across all deployed apps and it uses less memory(?). The drawback is that all the apps will share the library and you MUST have pesistence turned on and functioning. It looks like each time an app hits the BC4J lib, the persistence mechanism persists the current app's data, and then switches to the new app. I presume this happens everytime one app competes with another app for BC4J.
I have also seen BC4J deployed with every application. This presumably would give every app it's own BC4J runtime and therefore avoid any conflicts. Would it also mean better peformance assuming the box has plenty of memory? Or is is slower than Option 1?
Anyone else have any comments or additions? I just wnat to understand the best way, if there is one, to deploy BC4J to OC4J.
Thx,
Eric

Can you elobarate on what you mean by
"The drawback is that all the apps will share the library and you MUST have pesistence turned on and functioning."
These options control how the the bc4j classes are loaded and have no bearing on application data. Each .ear on oc4j is loaded by a different classloader instance. So beploying bc4j runtime jars in each ear would mean that these classes are loaded multiple times -- which is redundant and would only consume more memory. That's why I think option 1 is the better choice.
Dhiraj Dhiraj,
all I meant by that is that you HAVE to have the BC4J persistence collection stuff turned on. We had initially tried to disable this due to some other issues, but running with it off caused errors when trying to run multiple apps. As soon as BC4J persistence collection was turned back on, everything started working correctly.
I think you are right about the memory thing and I haven't heard any reason not to use Option 1 (a single set of libraries).
Thx.

Similar Messages

  • BC4J ApplicationModule - best practice in Stateful web application?

    When writing a stateful web application that uses BC4J framework as the model, what is considered best practice in using the Application Module. Is it okay to store an AM instance in a HttpSession, or should we opt for the features explained in the BC4J Pooling samples, which uses the SessionCookie interface?
    Tips/Tricks/Pitfalls information welcome
    Thx,

    When writing a stateful web application that uses BC4J framework as the model, what is considered best practice in
    using the Application Module. Is it okay to store an AM instance in a HttpSession, or should we opt for the features
    explained in the BC4J Pooling samples, which uses the SessionCookie interface? Best practice is to store the SessionCookie (an ApplicationModule handle) as demonstrated in the pooling sample.
    This will allow many advantages including scalable state management support, timeout support, and
    failover / clustering support.
    Caching the ApplicationModule directly can be dangerous because:
    1. The AM is not serializable which could result in serialization exceptions if the servlet container were distributable.
    2. The AM does not responsd to timeout which could result in memory leaks if the AM is not explicitly returned to the
    pool at the end of each request.
    3. For stateful applications the memory consumed by each AM could be significant. Even if the AM were correctly
    released to the pool upon session timeout it would still have consumed that memory up to that point. Using the
    SessionCookie along with state managed release allows for scalable state management.
    Tips/Tricks/Pitfalls information welcome
    Thx,

  • BC4J Best Practices

    Hi,
    I am looking for any best practices doc from Oracle or anyone on implementing features in BC4J objects. Examples will be "Where a method/feature should go?"
    I am facing a choice of writing the insert, update and delete methods in the view objects, but it is equally possible and correct if I have them in the app modules, by obtaining a handle to the view object. But which one is the best practice?
    Please add your comments and suggestion to this thread?
    Patrick.

    Hi,
    We use only Stateful release modes for application modules, defined in the action mappings in struts-config.xml exactly the same way as in your example. Stateful mode releases the module instance back to the pool and it can be reused by other sessions as well. However, all the code that uses the app modules and view objects, etc, must be written with the assumption that the module or the view object the code is operating on can be a different instance from the one in the previous request in the same session.
    The concept of BC4J is that this recycling of modules should be transparent for the users of the app modules, but this is not exactly the case. Some things are not passivated in the am's snapshots and are not activated in case of recycling, for example, custom view object properties or entries in the userData map (or at least were not in 9.0.5, I doubt this is changed in 10.1.2.) These are things that you have to manually passivate and activate if you use them to store some information that is relevant to a particular user session.
    All chances are that these strange things that you experience only occur in sessions that use recycled application modules, that is, there was passivation and subsequent activation of vo and am states. I have found it useful as a minimum to test the application with only 1 application module in the pool and at least 2 user sessions, constantly recycling this one am instance. Many of the problems that will surface in a real application usage only when there is a high load can be experienced in this artificial setup.

  • Best Practice for SOA-oc4j using more than 4 GB

    Hi,
    is there any best practice how to use the SOA container with more than 4GB?
    Oracle ships only java with 32 Bits...

    If you need to modify the myRIO FPGA personality you have a few options.
    The best option is to start with the myRIO FPGA sample project, add and remove components as needed and then build your bitfile.  Any registers (LV FPGA controls / indicators) you don't modify will still work with the Advanced IO VIs and Express VIs.  In order to use the new bitfile (FPGA Personality) you'll need to update the Open FPGA VI Reference in myRIO v1.1 Open.vi (LabVIEW 2013\vi.lib\myRIO\Common\Instrument Driver Framework\myRIO v1.0\myRIO v1.1 Open.vi).
    After doing this any time you use a myRIO Express VI or Advanced IO VI it will use your custom bitfile.  Any peripheral channels you've left in place will continue to work.  Any channels you've removed will still show up in the VIs, but will not work (they will probably throw errors at runtime) and any new channels you added will not show up in the VIs.  For new channels you'll need to use the FPGA Read / Write nodes to read and write the configuration and data register you created in the FPGA personality.  These changes will persist on that computer until you change the Open FPGA VI Reference back to the original bitfile.
    Let us know if you have questions about any of this.
    Thanks!
    -Sam K
    LabVIEW Hacker
    Join / Follow the LabVIEW Hacker Group on google+

  • Best practices question

    I've been starting to work with JDev 9.0.3 and web services, and I can see clearly how to:
    -- take my existing database information and create a web service for it. I've done this with PL/SQL, and will start trying to do it with BC4J shortly.
    -- take an existing WSDL and generate a stub to call it, and then use Java to make sense out of the structured information that comes back.
    But it looks like my real task will be to:
    -- import an existing XML schema (created elsewhere)
    -- map that to my relational database structure
    -- build a webService that will deliver that schema, based on information in the database
    (we'll also be going the other direction and doing inserts and updates).
    We're expecting to do a lot of these. I want to make it as simple as possible for those who will follow me. And I'd like to minimize the work involved when the schema changes, which it certainly will. I can see parts of the picture, but I'm sure I don't see the whole thing.
    So does anybody have any suggestions?
    -- jim

    I am not sure I can claim best practices but can point you at some solutions that may help shape your thinking:
    -- import an existing XML schema (created elsewhere) Here you may have two choices for processing from the mid-tier:
    1. Deserialize the incoming XML document into some sort of Java object so you can deal with it programmatically - see the above message on MS SOAP/Oralce SOAP interoperability for an example of this that ships with OC4J - then do JDBC inserts based on those Java objects into the DB.
    2. Work with it as an XML document - JDev 9.0.3 should produce a client to document based Web services. Here you can use either Oracle9i XMLDB or the XML SQL Utility to map to the DB.
    I am not sure one approach is better than another. How you deal with your second point will probably drive the choice.
    -- map that to my relational database structure
    With Oracle as the receiving point, you have a number of choices:
    1. Oracle9i DB R2. This will let you register an XML Schema in the database and using extra annonations in the schema, the database itself will actually map incoming documents defined by schemas directly to tables. This would imply in part 1 of my answer, keeping the incoming document in a DOM format. See the new XML Center, 2nd headline for all info on XML DB, particularly the rather extensive demo that just came out with that launch.
    2. XML SQL Utility. This utility lets you programmatically take an XML document and if it is in a canonical format (<ROWSET><ROW><COLNAME1>xxx</COLNAME1><COLNAME2>xxx</COLNAME2>...</ROW><ROWSET>) lets you do inserts, updates, deletes. The trick here would be doing a transformation from the incoming schema to the appropriate canonical format. This to suggests keeping the incoming Web service in XML format
    3. Deserialize into Java objects and then programmatically do the JDBC processing to insert, update, delete etc.
    -- build a webService that will deliver that schema, based on information in the database
    Here XSU might be quite nice. It has the ability to deliver the schema as part of the body of the XML document extracted from the database ... any select statement with this extra parameter will including the header of the document the schema (or DTD). See:
    Intro:
    http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/appdev.920/a96621/adx01bas.htm#1002519
    and
    More detailed, including mapping issues:
    http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/appdev.920/a96621/adx08xsu.htm
    and for the schema generation, see the extra parameter to the XMLQuery method:
    http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/appdev.920/a96616/arxml08.htm#1004604
    The dept/emp service here on OTN does exactly that using the XSU (sans the schema information). See:
    http://otn.oracle.com/tech/webservices/htdocs/series/deptemp/content.html
    As for which is better, I think it depends on where you are coming from. If you want to take advantage of your investment in the Oracle DB, the XML DB is probably the more powerful approach. If you like doing all the work in the middle tier, the XSU or deserialization approach mentioned above might fit better.
    Mike.

  • Best practice recommendation--BC set

    Dear friends,
       I am using BC set concept to capture my configurations. I am a PP Consultant.
    Let us consider, one scenario, Configure plant parameters in t.code OPPQ.
    My requirement is:
    A.   Define Floats: (Schedule Margin key)
    SM key: 001
    opening period: 1day
    Float before prod: 2day
    Float After prod: 1 day
    Release period: 1 day
    B.   Number range
    Manitain internal number range as: 10-from:010000000999999999. (for planned orders)
    This is my configuration requirement.
    Method M1:
    Name of the BC set: ZBC_MRP1
    while creating BC set first time, while defining floats, i have wrongly captured/ activated the opening periodas 100, instead of 001. But i have correctly captured the value for number range (for my planned orders)
    Now if u see the activation log for my BC set, my BC set is in "GREEN" light--Version1, successfully activated, but activated values are wrong)
    So, i want to change my BC set values. Now i want to reactivate my BC set with correct value. Now i am again activating the same BC set with corret value of opening period (Value as 001 ). After reactivating the BC set, if i get into my BC set activation log, one more version (version 2) has appeared with "GREEN" light.
    So in my activation log, two BC sets are visible.
    If i activate Version 1---wrong values will be updated in configuration
    If i activate Version 2---corrrect values will be activated in configurations
    But both versions can be activated at any point of time. The latest activated version will be alwyas in top.
    <b>So method 1 (M1) talks about, with one BC set name, maintain different versions of BC set.</b>...Based on your requirement activate the versions
    Method 2 (M2)
    Instead of creating versions within a same BC set, create one more BC set to capture new values.
    So if i activate second BC set, the configuration will be updated.
    Please suggest me, which method is best practice( M1 or M2)?
    Thanks
    Senthil

    I am familiar with resource bundles, but wonder if there is a better approach within
    JDeveloper. Resourcebundles are the java-native way of handling locale-specific texts.
    Are there any plans to enhance this area in 9.0.3? For BC4J, in 9.0.3, all control-hints and custom-validation messages (new feature) are generated in resource-bundles rather than xml-files to make it easier to "extend" for multiple locales.

  • Best Practice for Resolving OAS 10g R3 Classloading Issues

    What's the best practices for eliminating classloading issues for shared libraries that are loaded by default (apache.commons.logging, oracle.toplink, etc) in OAS 10g R3?
    So far it looks like my options are to exclude the conflicting JARs in my deployed applications or manually remove the entries from the application.xml and system-application.xml files in the OC4J instance config directory.
    I know that I can override the shared libraries loaded from the system-application.xml by using the <web-app-class-loader search-local-classes-first="true"/> element in my orion-web.xml but is that the best practice? Also note that this solution does not override the apache.commons.logging shared library loaded from the container's application.xml.
    So what is the best practice?

    What's the best practices for eliminating classloading issues for shared libraries that are loaded by default (apache.commons.logging, oracle.toplink, etc) in OAS 10g R3?
    So far it looks like my options are to exclude the conflicting JARs in my deployed applications or manually remove the entries from the application.xml and system-application.xml files in the OC4J instance config directory.
    I know that I can override the shared libraries loaded from the system-application.xml by using the <web-app-class-loader search-local-classes-first="true"/> element in my orion-web.xml but is that the best practice? Also note that this solution does not override the apache.commons.logging shared library loaded from the container's application.xml.
    So what is the best practice?

  • Best practices Struts for tech. proj. leads

    baseBeans engineering won best training by readers of JDJ and published the first book on Struts called FastTrack to Struts.
    Upcoming class is live in NYC, on 5/2 from 7:30 AM to 1:00PM. We will cover db driven web site development, process, validation, tiles, multi row, J2EE security, DAO, development process, SQL tuning, etc.
    We will teach a project tech lead methods that will increase the productivity of his team and review best practices, so that they can benchmark their environment.
    Sign up now for $150, the price will be $450 soon as we get closer to the date (price goes up every few days). The web site to sign up on is baseBeans.net* .
    You will receive a lab/content CD when you sign up.
    Contact us for more details.
    ·     We preach and teach simple.
    ·     We use a very fast DAO DB Layer – with DAO side data cache
    ·     We use JSTL
    ·     We use a list backed Bean w/ DAO helper design for access to any native source and to switch out DAO.
    ·     We use J2EE security, container managed declarative authorization and authentication. (no code, works on any app. server).
    ·     Struts based Content Management System. A Struts menu entry like this:
    <Item name="About_Contacts"      title="About/Contacts"
    toolTip="About Us and Contact Info" page="/do/cmsPg?content=ABOUT" />
    passes to the action the parm of “about” which the DAO populates.
    You can peak at the source code at sourceforge.net/projects/basicportal or go to our site baseBeans.net. (16,000 downloads since Oct. 2002)
    Note that the baseBeans.net is using the Content Management System (SQL based) that we train on. (our own dog food)
    Note: We always offer money back on our public classes.
    Vic Cekvenich
    Project Recovery Specialist
    [email protected]
    800-314-3295
    <a href =”baseBeans.net”>Struts Training</a>
    ps:
    to keep on training, details, best practice, etc. sign up to this mail list:
    http://www.basebeans.net:8080/mailman/listinfo/mvc-programmers
    (1,000 + members)

    Hi,
    We use only Stateful release modes for application modules, defined in the action mappings in struts-config.xml exactly the same way as in your example. Stateful mode releases the module instance back to the pool and it can be reused by other sessions as well. However, all the code that uses the app modules and view objects, etc, must be written with the assumption that the module or the view object the code is operating on can be a different instance from the one in the previous request in the same session.
    The concept of BC4J is that this recycling of modules should be transparent for the users of the app modules, but this is not exactly the case. Some things are not passivated in the am's snapshots and are not activated in case of recycling, for example, custom view object properties or entries in the userData map (or at least were not in 9.0.5, I doubt this is changed in 10.1.2.) These are things that you have to manually passivate and activate if you use them to store some information that is relevant to a particular user session.
    All chances are that these strange things that you experience only occur in sessions that use recycled application modules, that is, there was passivation and subsequent activation of vo and am states. I have found it useful as a minimum to test the application with only 1 application module in the pool and at least 2 user sessions, constantly recycling this one am instance. Many of the problems that will surface in a real application usage only when there is a high load can be experienced in this artificial setup.

  • UDDI and deployed Web Services Best Practice

    Which would be considered a best practice?
    1. To run the UDDI Registry in it's own OC4J container with Web Services deployed in another container
    2. To run the UDDI Registry in the same OC4J container as the deployed Web Services

    The reason you don't see your services in the drop-down is because, CE does lazy initialization of EJB components (gives you a faster startup time of the server itself). But your services are still available to you. You do not need to redeply each time you start the server. One thing you could do is create a logical destinal (in NWA) for each service and use the "search by logical destination" button. You should always see your logical names in that drop-down that you can use to invoke your services. Hope it helps.
    Rao

  • Best Practices for starting up and shutting down OAS

    A co-worker suggested that we set all processes on our Application Server to manual, and enter the startup sequence (opmn, em, etc) in autoexec.nt. Is this a best practice? Has anyone done this? I cant find any examples of this online. Does anyone see any advantages to doing this? I think they mentioned that this will ensure the OS loads the applications in the correct order.

    and set all the services to "Manual"? Yes
    you created a batch file and call it from autoexec.nt? my OS was W2000, anyway the batch was executed at system startup
    net start C:\oracle\midhome\bin\nmesrvc.exe
    net start C:\oracle\midhome\opmn\bin\opmn.exe -SI didn't use those commands, I used dcmctl to start http server and OC4J for infrastructure and midtier, after starting services.
    In other installations I also used opmnctl startall.
    Message was edited by:
    Paul M.

  • Best practice recommendation for locale-specific text/labels

    What is the recommended best practice approach to supporting locale-specific
    text for labels, messages when using Jdeveloper to create applets and applications.
    I am familiar with resource bundles, but wonder if there is a better approach within
    JDeveloper. Are there any plans to enhance this area in 9.0.3?

    I am familiar with resource bundles, but wonder if there is a better approach within
    JDeveloper. Resourcebundles are the java-native way of handling locale-specific texts.
    Are there any plans to enhance this area in 9.0.3? For BC4J, in 9.0.3, all control-hints and custom-validation messages (new feature) are generated in resource-bundles rather than xml-files to make it easier to "extend" for multiple locales.

  • ESB Exception Handling Best Practices

    I've update the "ESB Transactions, Error Handling and Resubmit" Lesson PDF to include a best practices section. Go to http://otn.oracle.com/goto/esb and click on the link in the Learning more section. Feedback welcome.

    Hi Dave,
    I checked this document yesterday, it contained 18 pages.
    Some great info in the additional 7 pages, just in time as well: at a customer site we are hitting bug 5547165, the rejected messages being empty. I checked the rejection handlers for BPEL and was investigating how these could be used in case of ESB. Seems you have provided the answer.
    Any chance a fix for the bug mentioned here is in the 10.1.3.3 patch set?
    One more thing: by default the rejected messages for ESB are written to file system, in a directory below the 'home' OC4J instance. Could this be turned into a configurable space in a next release?
    Thanks and best regards, Sjoerd

  • Oracle VM Best Practices

    Hello,
    Can anybody share Best practices for Oracle VM implementation and the test plan executed to validate the implementation before moving to production.
    Thanks in advance
    Dani

    NAME TARGET STATE SERVER STATE_DETAILS
    Local Resources
    ora.DATA.dg
    ONLINE ONLINE orarac001
    ONLINE ONLINE orarac002
    ora.LISTENER.lsnr
    ONLINE ONLINE orarac001
    ONLINE ONLINE orarac002
    ora.asm
    ONLINE ONLINE orarac001 Started
    ONLINE ONLINE orarac002 Started
    ora.eons
    ONLINE ONLINE orarac001
    ONLINE ONLINE orarac002
    ora.gsd
    OFFLINE OFFLINE orarac001
    OFFLINE OFFLINE orarac002
    ora.net1.network
    ONLINE ONLINE orarac001
    ONLINE ONLINE orarac002
    ora.ons
    ONLINE ONLINE orarac001
    ONLINE ONLINE orarac002
    ora.registry.acfs
    ONLINE ONLINE orarac001
    ONLINE ONLINE orarac002
    Cluster Resources
    ora.LISTENER_SCAN1.lsnr
    1 ONLINE ONLINE orarac001
    ora.LISTENER_SCAN2.lsnr
    1 ONLINE ONLINE orarac002
    ora.LISTENER_SCAN3.lsnr
    1 ONLINE ONLINE orarac002
    ora.oc4j
    1 OFFLINE OFFLINE
    ora.orarac001.vip
    1 ONLINE ONLINE orarac001
    ora.orarac002.vip
    1 ONLINE ONLINE orarac002
    ora.orcl.db
    1 ONLINE ONLINE orarac001 Open
    2 ONLINE ONLINE orarac002 Open
    ora.scan1.vip
    1 ONLINE ONLINE orarac001
    ora.scan2.vip
    1 ONLINE ONLINE orarac002
    ora.scan3.vip
    1 ONLINE ONLINE orarac002
    I'm assuming the "offline" ones are bad :)
    EDIT:
    it turns out that the offlines in the list are completely normal for 11gR2
    any one have any idea what's going on??
    Thanks!
    Edited by: user12245235 on Jul 28, 2011 5:24 PM

  • Best practicies exposing AM (OAF 11.5.10) as webservice to external systems

    IHAC how is developing extensions to there ebusiness install base using OAF 11.5.10 and they have approached me with questions on how they could expose some of the business services developed (AM VO mainly) as webservices to be used in a BPEL/Webservice framework. The BPEL service is seebeyond (not sure how it is spelled) and not Oracle's.
    I have outlined 2 ways, but since I have not developed anything on OAF I have no idea it is possible.
    First was to migrate the ADF BC (or BC4J) projects from OAF with JDeveloper 10.1.3 and just more or less create a simple facade layer of a session bean right-click and deploy as webservice.
    Second: was to use a webservice library such as axis to be used in JServ directly to expose them on the "target" server.
    Has anyone any best practicies on this topic,

    For recognition and stable functionality of USB devices, your B&W G3 should be running OS 8.6 minimally. The downloadable OS 8.6 Update can be run on systems running OS 8.5/8.5.1. If (after updating to 8.6), your flash drive still isn't recognized, I'd recommend downloading the OS 9.1 Update for the purpose of extracting its newer USB support drivers, using the downloadable utility "TomeViewer." These OS 9.1 USB support files can be extracted directly to your OS 8.6 Extensions folder and are fully compatible with the slightly older OS software. It worked for me, when OS 8.6's USB support files lacked a broad enough database to support my first USB flash drive.

  • ADF Deployment Granularity - Best Practices

    Hi People,
    If anyone can spare some time to discuss this, I would like some pointers about ADF applications deployment best practices. For example, we have some customers that complain about having to re-deploy the entire application EAR just to add a field "rendered" condition on a single page, and also having to re-deploy the ADF BC model JARs even though the application has only been changed on the view layer.
    What level of deployment granularity can we JDeveloper + ADF developers provide to our customers, without the risk of having inconsistency or dependency problems? So far, our strategy is to deploy the BC Model layer to separate JARs and the View Layer in a WAR file, packaging everything in an EAR. Is it feasible to allow the developers to change one single page and generate a deployment archive for just that single page? If not, which arguments can i provide in a discussion to support the single-deployment point of view?
    Thanks for your time, and regards!
    Thiago

    Hi Thiago
    Interesting question and one that comes up from time to time with JEE applications. I've been doing some research on this issue, and recently blogged about how OC4J and BEA Weblogic handles this scenario. Hopefully the post and reference to the OTN post gives you more information, though I'd be interested if you're research reveals a different approach.
    I'm also hoping this issue comes up at the OOW ADF Methodology chat among the JDev experts, it would be good for the experts to share their different approaches to this common issue.
    I know this doesn't give you a direct answer but hopefully will be useful.
    Cheers,
    CM.

Maybe you are looking for