Ejb hotdeploy, classloading & singleton

I have the following doubt about hot-deploy, classloading & singletons.
Let´s assume I have a sessionbean which accesses a singleton. As far as I understand
hot-deploy in weblogic, during a hot-deployment, a sessionbean instance currently
engaged in a transaction is not unloaded untill the transaction is completed.
New transactions however would access the newly deployed & loaded instances of
the new version of my session bean.
Am I correct to assume that, if this is the case, several instances of my singleton
may exist at a certain moment in the same JVM (I am not talking about clusters,
but about execution threads).

Hi Seth
Are you hot redeploying the entire application? Is the singleton class
packaged with the application?Yes the singleton is packaged with the application. It´s actually the Bussiness
Delegate.
>
Thanks.
Seth
"Sven van ´t Veer" wrote:
I have the following doubt about hot-deploy, classloading & singletons.
Let´s assume I have a sessionbean which accesses a singleton. As faras I understand
hot-deploy in weblogic, during a hot-deployment, a sessionbean instancecurrently
engaged in a transaction is not unloaded untill the transaction iscompleted.
New transactions however would access the newly deployed & loaded instancesof
the new version of my session bean.
Am I correct to assume that, if this is the case, several instancesof my singleton
may exist at a certain moment in the same JVM (I am not talking aboutclusters,
but about execution threads).

Similar Messages

  • Hot deploy, classloading & singletons

    I have the following doubt about hot-deploy, classloading & singletons.
    Let´s assume I have a sessionbean which accesses a singleton. As far as I understand
    hot-deploy in weblogic, during a hot-deployment, a sessionbean instance currently
    engaged in a transaction is not unloaded untill the transaction is completed.
    New transactions however would access the newly deployed & loaded instances of
    the new version of my session bean.
    Am I correct to assume that, if this is the case, several instances of my singleton
    may exist at a certain moment in the same JVM (I am not talking about clusters,
    but about execution threads).

    Hi Seth
    Are you hot redeploying the entire application? Is the singleton class
    packaged with the application?Yes the singleton is packaged with the application. It´s actually the Bussiness
    Delegate.
    >
    Thanks.
    Seth
    "Sven van ´t Veer" wrote:
    I have the following doubt about hot-deploy, classloading & singletons.
    Let´s assume I have a sessionbean which accesses a singleton. As faras I understand
    hot-deploy in weblogic, during a hot-deployment, a sessionbean instancecurrently
    engaged in a transaction is not unloaded untill the transaction iscompleted.
    New transactions however would access the newly deployed & loaded instancesof
    the new version of my session bean.
    Am I correct to assume that, if this is the case, several instancesof my singleton
    may exist at a certain moment in the same JVM (I am not talking aboutclusters,
    but about execution threads).

  • Problem with EJB skeleton classloader

    Hi
    We have been migrating an enterprise application from Weblogic 7 to 9.2 and experienced strange problem with EJBs. Our EAR contains (beside the other elements) an EJB module with EJBs and some common POJO classes inside. At the deploy and run phase everything seems working fine, but when the remote client invokes a method which receives one of the common classes as a parameter we get ClassNotFoundException on the server side (talking precisely, the exception is thrown from the EJB skeleton, trying to unmarshall the parameter).
    It seems that our EJB's skeletons do not see the classes from EAR. We have tried moving the common classes to the APP-INF/lib directory or placing them at the root of EAR archive and adding reference in Manifest file of EJB module and it won't help.
    The only workaround we've found is to add the missing classes to the server classpath but this is unacceptable (however, it works).
    We are not using any custom classloader hierarchy.
    The other JARs have no problem loading the content of our EJB module (including the common classes, which cause the problem).
    So, why is the RMI classloader ommiting our application contents?

    The problem was fixed by upgrading to version 9.2.1

  • Ejb deployment - classloader question

    Hi Guys
    I have a very basic question regarding EJB deployment in Weblogic 6.1 sp2.
    Is it possble to create an EAR file such that -
    1>it contains a WAR file [of servlets/jsps/client classes] - A
    2>a jar file containing our core server classes[not EJBs] - B
    3>a jar file containing EJBs - C
    here A and C are definitely getting loaded by different class loaders - I want
    the classloader for B to be parent of the classloaders for A and C - so that both
    A and C can see B. - is this possible by some EAR/Weblogic specific way.
    OR
    the best solution is to place the B in the main classpath and deploy the C and
    A in an EAR?
    thanks
    Anamitra

    Inline.
    Anamitra wrote:
    Hi Guys
    I have a very basic question regarding EJB deployment in Weblogic 6.1 sp2.
    Is it possble to create an EAR file such that -
    1>it contains a WAR file [of servlets/jsps/client classes] - A
    2>a jar file containing our core server classes[not EJBs] - B
    3>a jar file containing EJBs - C
    here A and C are definitely getting loaded by different class loaders - I want
    the classloader for B to be parent of the classloaders for A and C - so that both
    A and C can see B. - is this possible by some EAR/Weblogic specific way.Made possible by placing B in the ear at the root level and referring to B with the
    Class-Path manifest directive in the ejb jar file for C. This will put B in the ejb
    classloader's classpath making it visible to C and to A since the classloader for C
    is the parent of the classloader for A. Which, is the recommended way.
    >
    OR
    the best solution is to place the B in the main classpath and deploy the C and
    A in an EAR?
    This works, but the classfiles in B are now static for the uptime of the server. If
    you want to make changes in B, you must restart the server. If you configure it the
    way described above, you can reload the B classes by redeploying the application ear.
    >
    thanks
    AnamitraHere is the link with all of the info:
    http://edocs.bea.com/wls/docs61/programming/packaging.html#1029830
    Bill

  • EJB 3.1 @Singleton with @Startup causes @PostConstruct to be called twice...

    I have been working on initializing a some elements in the @PostConstruct annotated method within an EJB that is already annotated as @Singleton.  I decided that I wanted the initialization to be done when the EJB is deployed so I added the @Startup.  Both the constructor and @PostConstruct method is getting called twice.  Can someone please explain to me why it appears the EJB is being initialized twice and if there is a way to prevent the @PostConstruct method from being called twice?
    Many thanks,
    - Joe

    Is this with GlassFish?

  • EJB n ClassLoading ..

    Hi,
    I trying to load different versions of ejb-client jar files into different ClassLoaders ..
    I am actually able to load the versioned valueobjects, but when I invoke a method on the bean ( using reflection ) passing the valueobjects I loaded, I get a 'NoSuchMethodException'.
    I think its because: the bean is loaded ( during home.create() ) by some network ( RMI ) ClassLoader and the valueobjects are actually loaded by my custom ClassLoader from jar file .. any help is greatly appreciated.
    Thanks.

    Ok,
    First, define the Server :
    Go to "Window" --> "Show View" --> "Other" ,
    Go to the node "Server", expand it then choose "Server"
    On the server view, right click then choose "New" --> "Server" then configure your Server paramaters.
    Then you can create a "J2EE Enterprise Application project", choose you Server as "Target Runtime".
    This should define your classpath correctly.
    But, if you are new to j2ee, this is just a warm up beceause EJB are not
    very easy to develop.
    Note : This allow you to create EJB 2.1 only !!!!!
    Regards,
    Sebastien Degardin.

  • Ejb, servlets, & customer libraries

    Hello,
    I'm in the process of upgrading from 5.1 to 6.1 and having some
    interesting issues regarding the various interdependent chunks of code.
    In 5.1 I have most of my shared code under <server>/serverclasses, and
    the servlet code under <server>/servletclasses. I've also got an EJB
    that uses some of the code in the serverclasses directory, and its being
    there seems to make it available at runtime to the EJB's classloader.
    Meanwhile, in order to make the EJB's home interface available to the
    servlet code at run time, the only solution I found was to include the
    jar file in the classpath handed to the java runtime in the startup
    shell script.
    Now, in 6.1 things have changed somewhat and i'm frankly not sure what
    the hell to do. I found someone had posted an article talking about
    bundling things in a .ear file. Honestly, I didn't really get it. I
    don't see why changing the extension on the jarfile is going to help at
    all.
    Anyway, this is my question: How can I make code available as a custom
    library that is available to the servlet run time, and to my EJB
    deployments?
    Here's my other question: If the EJB code is only in the .jar ( or
    whatever ) file that the EJB is packaged in, how exactly does the
    servlet runtime know about the home interface? Just deploying the bean
    doesn't seem to do the trick. Honestly, this seems like a pretty big
    design flaw in the EJB spec to me.
    thanks
    noah

    You may find these 2 articles helpful:
    http://www.onjava.com/pub/a/onjava/2001/06/26/ejb.html
    http://www.onjava.com/pub/a/onjava/2001/07/25/ejb.html
    Noah Couture <[email protected]> wrote:
    Hello,
    I'm in the process of upgrading from 5.1 to 6.1 and having some
    interesting issues regarding the various interdependent chunks of code.
    In 5.1 I have most of my shared code under <server>/serverclasses, and
    the servlet code under <server>/servletclasses. I've also got an EJB
    that uses some of the code in the serverclasses directory, and its being
    there seems to make it available at runtime to the EJB's classloader.
    Meanwhile, in order to make the EJB's home interface available to the
    servlet code at run time, the only solution I found was to include the
    jar file in the classpath handed to the java runtime in the startup
    shell script.
    Now, in 6.1 things have changed somewhat and i'm frankly not sure what
    the hell to do. I found someone had posted an article talking about
    bundling things in a .ear file. Honestly, I didn't really get it. I
    don't see why changing the extension on the jarfile is going to help at
    all.
    Anyway, this is my question: How can I make code available as a custom
    library that is available to the servlet run time, and to my EJB
    deployments?
    Here's my other question: If the EJB code is only in the .jar ( or
    whatever ) file that the EJB is packaged in, how exactly does the
    servlet runtime know about the home interface? Just deploying the bean
    doesn't seem to do the trick. Honestly, this seems like a pretty big
    design flaw in the EJB spec to me.
    thanks
    noah--
    Dimitri

  • WAR meta-inf/manifest Class-Path jars use which classloader ?

    If using an expanded EAR structure, my Web App requires some utility classes. I
    can either put these in my :-
    meta-inf/manifest.mf
    Class-Path : utility.jar
    OR
    web-inf/lib
    can contain the utility.jar
    Is there any difference in terms of which classloader is used to load these classes,
    the EAR/EJB classloader or the Web App child classloader ?
    What is recommended ?

    If have found out the answer myself by testing it :-
    A jar in the meta-inf/manifest.mf e.g. Class-Path : utility.jar
    will be loaded by the EAR/EJB level classloader
    whereas
    web-inf/lib containing utility.jar
    will be loaded by the Web App level child classloader.
    Dimitri Rakitine <[email protected]> wrote:
    I have this question too - it appears that 6.1sp2 attempts to use Class-Path
    in jars in WEB-INF/lib - what this Class-Path: is supposed to do ???
    Pete <[email protected]> wrote:
    If using an expanded EAR structure, my Web App requires some utilityclasses. I
    can either put these in my :-
    meta-inf/manifest.mf
    Class-Path : utility.jar
    OR
    web-inf/lib
    can contain the utility.jar
    Is there any difference in terms of which classloader is used to loadthese classes,
    the EAR/EJB classloader or the Web App child classloader ?
    What is recommended ?--
    Dimitri

  • What relationship between every classloader?

    Can I deploy several EJB JARS which have many enterprise beans in weblogic6.1sp2?
    what relationship between these ejb jars' classloader and web application's classloader?

    Can I deploy several EJB JARS which have many enterprise beans inweblogic6.1sp2?
    what relationship between these ejb jars' classloader and webapplication's classloader?
    Typically you'd put all those JARs and the WAR into an EAR. Then they'd
    share a classloader (although there's actually more than one involved). If
    you have problems, you can start consolidating; in case of emergency, tend
    to consolidate toward all the classes (including web app) being in one JAR.
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    http://www.tangosol.com/coherence.jsp
    Tangosol Coherence: Clustered Replicated Cache for Weblogic
    "ejb" <[email protected]> wrote in message news:3d9287f2$[email protected]..
    >

  • Re-initialize EJB

    I have an implementation of an EJB that executes some code during the @PostConstruct. While my application is running, there are many instances of the EJB. Is there any way to force the application to call the code in @postConstruct (maybe with a different annotation) for each instance of the bean?
    This is what I would like to see happen.
    - bean gets initialized and calls @PostConstruct method during startup
    - application runs and uses bean for some time
    - application gets a trigger (from a timer or webservice) to call bean.reinitialize()
    - bean.reinitialize() tells the application to call the bean method with @PostConstruct (or a different annotation) once for each instance of the bean
    Does something like this exist with EJBs?

    r035198x wrote:
    user2695214 wrote:
    Wow, thanks for the reply. I was hoping it would not need to be overly complicated.
    In your first response you mentioned a "proper cache". What did you mean by this? Is there a some EJB construct for this or was there something more simple that you were referring to?If you are using JPA for persistence then your (persistence) provider would already come with some form of second cache implementation that you would need to configure or you can use existing caching APIs yourself like ehchache.Yep, a second-level cache would definitely be my first thought as well. that fits very well into the existing ejb/jpa infrastructure.
    that said, if you are working with some sort of non-jpa data, then you are looking at a custom cache situation. i would implement something like that using a JMX management bean (although initializing these in the ejb world is not as easy as it should be). you could probably also implement this using an ejb 3.1 singleton ejb.

  • CORBA connections not relinquished - CPU usage - 100%

    We have a session bean making a corba call, however after the call is susccessful,
    the connection doesn't relinquished. If We do a netstat , the number of established
    connections keep increasing as more calls are made to the CORBA server. We am
    facing issues of CPU usage goin upto 100% and never comes below 97% after a lot
    of such calls. Please suggest someway of fixing it.

    You should verify it within the product documentation.
    If you want to verify it by yourself, from wls, implementing the singleton pattern
    for your remote object, invoke a method on the remote object, implement a sleep
    in it (on the corba server), and after try to execute another method on the same
    remote object (singleton), which returns immediately (it is important that you
    run this test within the same wls instance, and the same ejb (ejb module) : the
    singleton is relative to the classloader).
    If the orb implementation does not multiplex the invokations, you will see the
    second call not returning until the first one has not returned (end of sleep time).
    (of course, I suppose the Corba server is multithreaded...)
    Sergi
    "Nishant" <[email protected]> wrote:
    >
    Perfect....thanks....but isnt using singleton going to harm the performance..coz
    this is old version of visibroker, and it prbably doesnt multiplex the
    threads??
    "Sergi Vaz" <[email protected]> wrote:
    Hello,
    use the ORB as a "singleton" object : do not invoke ORB.init many times,
    but only
    once, and after cache the corba object on a static variable.
    It's thread safe, the remote invocations will be multiplexed.
    So you will have only "one" reader thread for each corba object, and
    you will
    solve your problem.
    Some vendor are not fully compliant and do not implement the destroy
    method.
    So you do not release the ORB resources, but keep them (it's also more
    performant).
    At this point you will have a "dangling" reader thread only after aredeploy
    (unless
    you shut down the jvm).
    Sergi
    "Nishant" <[email protected]> wrote:
    Andy,
    I am using visibroker 3.2. , and WLS 7.0 , JSK 1.3.1_08 And I do not
    see a method
    called org.omg.CORBA.ORB.destroy.
    Is there an alternative way to achieve this??
    Unless I destroy the threads the connection with the CORBA server would
    remain,
    and this is driving up the CPU usage, for every new connection made.
    Thanks
    Nishant
    Andy Piper <[email protected]> wrote:
    "Nishant" <[email protected]> writes:
    We have a session bean making a corba call, however after the callis susccessful,
    the connection doesn't relinquished. If We do a netstat , the numberof established
    connections keep increasing as more calls are made to the CORBA
    server.
    We am
    facing issues of CPU usage goin upto 100% and never comes below
    97%
    after a lot
    of such calls. Please suggest someway of fixing it.This is most likely because you are using the JDK 1.3 ORB. It doesnot
    release threads until the system exits. This is one reason why using
    the BEA ORB in 8.1 is preferrable.
    If you are using WLS 7.0 then Sun did make a fix in JDK 1.3.1_09 which
    adds a special property to allow ORB.destroy() to release the
    threads. You would have to go through support to find out what this
    property is. If you are using 8.1 then you can use the BEA ORB or
    if
    you need to use the JDK ORB I think that calling ORB.destroy() will
    release the threads for you.
    Hope this helps.
    andy

  • 11g Release 1 Patch Set 3 (WLS 10.3.4)

    Hi.
    While creating new server in OEPE Helios(11.1.1.6) I found that WLS 10.3.4 is available for selection. However I didnt find any information neither links to download it. Only 10.3.3 is available.
    When and where it is\would be available for download?
    Thanks

    frf,
    Hello, as part of the WebLogic 10.3.4 release on friday - we verified JPA 2.0 functionality for enterprise users using JPA as their persistence pattern. The main issues were JPA 2.0 XSD validation and JPA 2.0 container managed persistence unit injection.
    The details of the following post outline what happens out of the box and how JPA 2.0 can be officially enabled on JEE5 compliant WebLogic 10.3.4 install +(with or without the QWG8 patch)+
    In 10.3.3.0 you were required to use the FilteringClassLoader via the *<wls:prefer-application-packages>* addition to your application managed persistence unit - this workaround is now deprecated and not required in 10.3.4.0 for both application and container managed persistence contexts.
    Specifically we will start retesting EE applications using a SSB injected @PersistenceContext container managed JTA transactional JPA 2.0 persistence units with/without JPA 2.0 XSD elements.
    I verified the server and it is using SVN rev# *8635 from 6 Dec 2010* https://fisheye2.atlassian.com/changelog/eclipselink/?cs=8635
    Essentially in order to enable JPA 2.0 functionality on WebLogic 10.3.4 shipped on 14 Jan 2011 - you apply the QWG8 patch below or manually edit your server classpath to put the JPA 2.0 persistence specification API jar and the com.oracle.jpa2support_1.0.0.0_2-0.jar ahead of the other liibraries on the classpath.
    commEnv.cmd: line 67
    @rem Set BEA Home
    set BEA_HOME=C:\opt\wls1034r20110115
    @rem Enable JPA 2.0 functionality on WebLogic Server 10.3.4 with the following patch line for commEnv.cmd:67
    set PRE_CLASSPATH=%BEA_HOME%\modules\javax.persistence_1.0.0.0_2-0-0.jar;%BEA_HOME%\modules\com.oracle.jpa2support_1.0.0.0_2-0.jarEverything is shipped with WebLogic 10.3.4 but JPA 1.0 is enabled by default so that this JEE5 capable server is backwards compatible with JEE5/JPA1 out of the box. Without the above patch you will see the following.
    <15-Jan-2011 5:58:40 o'clock PM EST> <Info> <Management> <BEA-141107> <Version: WebLogic Server 10.3.4.0 Fri Dec 17 20:47:33 PST 2010 1384255 >
    [EL Info]: 2011-01-15 18:06:38.082--ServerSession(48997950)--Thread(Thread[[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--EclipseLink, version: Eclipse Persistence Services - 2.1.2.v20101206-r8635
    [EL Info]: 2011-01-15 18:06:38.082--ServerSession(48997950)--Thread(Thread[[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Server: 10.3.4.0
    We have the required bundles in the modules directory...
    javax.persistence_1.0.0.0_2-0-0.jar (upgraded from 1-0-2)
    org.eclipse.persistence_1.0.0.0_2-1.jar (upgraded from 2-0)
    A very quick test of a JPA 2.0 container managed app with the following persistence.xml in the ejb.jar works as detailed below.
    There are 3 issues we must check.
    1) JPA 2.0 XSD parsing errors: as expected there are no more JPA 2.0 schema parsing issues.
    2) New JPA 2.0 schema elements like the *<shared-cache-mode>NONE</shared-cache-mode>* element - this passes validation but we need to verify runtime functionality
    3) JPA 2.0 runtime API like a entityManager.getMetamodel(); call on the Servlet or Statless session bean
    4) JPA 2.0 weaving/instrumentation - Again we need to verify something like weaving of Entities contaiing lazy IndirectLists are weaved properly by the container.
    Note: All testing in this post is on a WebLogic 10.3.4.0 install out-of-the-box. The only modification I made was in creating a derby 10.5.3.0 JTA global datasource "localJTA" on the server - and drop a container managed JPA 2.0 app as an EAR in the autodeploy directory on the default user domain.
    <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
        <persistence-unit name="example" transaction-type="JTA">
            <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> <!-- we will default to Kodo without specifying the provider -->
            <jta-data-source>localJTA</jta-data-source>
            <shared-cache-mode>NONE</shared-cache-mode><!-- shared-cache-mode must come after any class definitions (usually SE only) - the JPA schema is ordered -->
            <properties>
                <property name="eclipselink.target-server" value="WebLogic_10"/>
                <property name="eclipselink.target-database" value="Derby"/>           
                <property name="eclipselink.logging.level" value="FINEST"/>
                <!-- new for 10.3.4.0 http://wiki.eclipse.org/EclipseLink/Examples/JPA/Logging#Server_Logging  -->
                <property name="eclipselink.logging.logger" value="DefaultLogger"/>
                <!-- turn off DDL generation after the model is stable -->           
                <!-- property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
                <property name="eclipselink.ddl-generation.output-mode" value="database"/-->
            </properties>      
        </persistence-unit>For 3) we get the following exception out of the box on a servlet if we do not apply the above mentioned patch below - because the container defaults to Java EE 5 functionality - or JPA 1.0
    http://download.oracle.com/docs/cd/E18476_01/doc.220/e18480/weblogicchap.htm
    java.lang.NoSuchMethodError: javax/persistence/EntityManager.getMetamodel()Ljavax/persistence/metamodel/Metamodel;
    at org.eclipse.persistence.example.jpa.server.weblogic.enterprise.presentation.FrontController.processGliderComm
    and(FrontController.java:346)
    or 3) The same exception if we try to run JPA 2.0 on the DI entityManager from the SSB in the EJB container classLoader
    javax.ejb.EJBException: EJB Exception: : java.lang.NoSuchMethodError: javax/persistence/EntityManager.getMetamodel()Ljavax/persistence/metamodel/Metamodel;
    +     at org.eclipse.persistence.example.jpa.server.business.ApplicationService.insertObjects(ApplicationService.java:66)+
    +     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)+
    +     at java.lang.reflect.Method.invoke(Method.java:597)+
    +     at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)+
    +..+
    +     at $Proxy74.insertObjects(Unknown Source)+
    +     at org.eclipse.persistence.example.jpa.server.business.ApplicationService_5ptwty_ApplicationServiceLocalImpl.__WL_invoke(Unknown Source)+
    We also get the Kodo/OpenJPA provider when we attempt to weave.
    +<openjpa-1.1.1-SNAPSHOT-r422266:965591 fatal user error> org.apache.openjpa.util.MetaDataException: "org.eclipse.persistence.example.jpa.server.business.Cell.id" declares generator name "EL_SEQUENCE_CELL", but uses the AUTO generation type. The only valid generator names under AUTO are "uuid-hex" and "uuid-string".+
    +     at org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser.getGeneratedValueStrategy(AnnotationPersistenceMetaDataParser.java:1226)+
    Therefore there is still a little bit of configuration required.
    Enabling JPA2 support
    1) install the QWG8 patch, or
    2) manually add the com.oracle.jpa2support_1.0.0.0_2-0.jar ahead of the server classpath by following the instructions in the documentation at
    http://download.oracle.com/docs/cd/E17904_01/web.1111/e13720/using_toplink.htm#EJBAD1309
    or doing it manually by modifying the following line
    C:\opt\wls10340_pub110115\wlserver_10.3\common\bin\commEnv.cmd
    set PRE_CLASSPATH=%BEA_HOME%\modules\javax.persistence_1.0.0.0_2-0-0.jar;%BEA_HOME%\modules\com.oracle.jpa2support_1.0.0.0_2-0.jar
    Results
    The following code
    @Local
    @Stateless
    public class ApplicationService implements ApplicationServiceLocal {
        @PersistenceContext(unitName="example", type=PersistenceContextType.TRANSACTION)     
        private EntityManager entityManager;
        public boolean insertObjects(List<Cell> classes) {
            try {
                for(int i=0; i< classes.size(); i++) {
                    entityManager.persist(classes.get(i));
                System.out.println("JPA 2.0 Metamodel: " + entityManager.getMetamodel());           ...prints out the JPA 2.0 EntityManager dependency injected into the SSB proxy for the life of the transaction in the function
    JPA 2.0 Metamodel: MetamodelImpl@34817119 [ 5 Types: , 2 ManagedTypes: , 2 EntityTypes: , 0 MappedSuperclassTypes: , 0 EmbeddableTypes: ]+
    +[EL Finer]: 2011-01-15 22:36:00.33--UnitOfWork(34913451)--Thread(Thread[[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--TX beforeCompletion callback, status=STATUS_ACTIVE+
    You can see that when we debug the stateless session bean $Proxy that has our injected EntityManager...
    this     ApplicationService_5ptwty_Impl  (id=11616)     
         __WL_EJBContext     SessionEJBContextImpl  (id=11654)     
         entityManager     $Proxy73  (id=11639)     
              h     TransactionalEntityManagerProxyImpl  (id=11638)     
                   appName     "org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEAR" (id=11513)     
                   closeMethod     Method  (id=11663)     
                   moduleName     "org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEJB.jar" (id=11515)     
                   persistenceUnit     PersistenceUnitInfoImpl  (id=11665)     
                   persistenceUnitName     "org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEAR#org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEJB.jar#example" (id=11666)     
                   queryMethods     HashSet<E>  (id=11668)     
                   transactionAccessMethod     Method  (id=11669)     
                   transactionalMethods     HashSet<E>  (id=11670)     
                   txHelper     TransactionHelperImpl  (id=11523)     
                   txRegistry     ServerTransactionManagerImpl  (id=11524)     
                   unqualifiedPersistenceUnitName     "example" (id=11672)     ...no longer complains about an unknown getMetamodel() JPA 2.0 method signature
    Oracle WebLogic Server 11gR1 PatchSet 3 r20110115 at localhost [Oracle WebLogic Server]     
         Java HotSpot(TM) Client VM[localhost:8453]     
              Daemon Thread [[ACTIVE] ExecuteThread: '20' for queue: 'weblogic.kernel.Default (self-tuning)'] (Running)     
              Daemon Thread [[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)'] (Suspended)     
                   TransactionalEntityManagerProxyImpl.invoke(Object, Method, Object[]) line: 18     
                   $Proxy59.getMetamodel() line: not available [local variables unavailable]     
                   ApplicationService_5ptwty_Impl(ApplicationService).insertObjects(List<Cell>) line: 60     
    ..               JdkDynamicAopProxy.invoke(Object, Method, Object[]) line: 204     
                   $Proxy71.insertObjects(List) line: not available     
                   ApplicationService_5ptwty_ApplicationServiceLocalImpl.__WL_invoke(Object, Object[], int) line: not available     
                   SessionLocalMethodInvoker.invoke(BaseLocalObject, MethodDescriptor, Object[], int, String, Class<?>) line: 39     
                   ApplicationService_5ptwty_ApplicationServiceLocalImpl.insertObjects(List) line: not available     
                   FrontController.generateGlider(PrintWriter) line: 252     
    ..               FrontController(HttpServlet).service(ServletRequest, ServletResponse) line: 820     
                   StubSecurityHelper$ServletServiceAction.run() line: 227     
    ..               ExecuteThread.run() line: 176     
    arg1     Method  (id=11511)     
         clazz     Class<T> (javax.persistence.EntityManager) (id=8312)     
         name     "getMetamodel" (id=11543)     
         returnType     Class<T> (javax.persistence.metamodel.Metamodel) (id=11545)     For 4) Weaving is occuring as expected on either the JPA 1.0 or JPA 2.0 entities. We check this by either checking that our Entity is an instanceof org.eclipse.persistence.internal.weaving.PersistenceWeaved interface, or debug into the Entity and look for our bytcode instrumented weaved fields that start with _persistence*.  The question is - we need a weaved field or weaved function that was introduced for JPA 2.0
    [4]     Cell  (id=11571)     
         _persistence_fetchGroup     null     
         _persistence_primaryKey     null     
         _persistence_session     null     
         _persistence_shouldRefreshFetchGroup     false     
         aCellAttribute     null     
         id     null     
         left     null     
         peers     HashSet<E>  (id=11572)     
              map     HashMap<K,V>  (id=11575)     
    com.oracle.jpa2support_1.0.0.0_2-0.jar forensicsI had a look at the patch jar com.oracle.jpa2support_1.0.0.0_2-0.jar that WebLogic 10.3.4 ships with that allows installers to enable JPA 2.0 (JSR-317) support to superceed the default JPA 1.0 (JSR-220) support. It looks like the container proxy code for container managed EntityManagerFactory and EntityManager $Proxy objects has been updated so that a JPA 2.0 EntityManager $Proxy object get injected with the proper API level object via the InvocationHandlerFactory, FactoryInterceptor. The Query proxy has been updated as well. There is a fix for Kodo(OpenJPA) and OpenJPA related to the recent change and deprecation of certain functions of those providers. The EclipseLink JPA 2.0 provider (as the provider for TopLink) did not need weblogic changes beyond placing the JPA javax.peristence 2.0 specification jar higher on the classpath.
    The root EclipseLink tracking bug is 334468
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=334468
    OTN downloadhttp://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-main-097127.html
    Patching
    http://download.oracle.com/docs/cd/E18476_01/doc.220/e18480/weblogicchap.htm
    Documentationhttp://download.oracle.com/docs/cd/E17904_01/web.1111/e13852/toc.htm
    Supported Oracle WebLogic Server Versionshttp://download.oracle.com/docs/cd/E15315_06/help/oracle.eclipse.tools.weblogic.doc/html/SupportedServerVersions.html
    TopLink JPA 2.0 Specifichttp://download.oracle.com/docs/cd/E17904_01/web.1111/e13720/using_toplink.htm#EJBAD1309
    see related
    JPA 2: Reverify JPA 2.0 XSD support in persistence.xml on AM/CM app on WebLogic 10.3.3.0
    http://bugs.eclipse.org/331569
    JPA 2.0: Add WebLogic 10.3 configuration process to enable the JPA 2.0 library functionality - updated
    http://bugs.eclipse.org/296271
    http://en.wikipedia.org/wiki/Oracle_WebLogic_Server - updated
    JPA: Add downloadable 60k weblogic.EAR to wiki page (outside of SVN) - reopened
    http://bugs.eclipse.org/294745
    JPA: support WebLogic 10.3.4.0 introduction of new JPA MBean that changes the default JPA provider
    http://bugs.eclipse.org/312824
    JPA: Update tutorial wiki for WebLogic 10.3 to match the Oracle WebLogic 11g 10.3.3.0 - assigned
    http://bugs.eclipse.org/310849
    To be answered
    OTN Post: WebLogic 10.0 + JPA 2.0 = errors - updated
    Re: WebLogic 10.0 + JPA 2.0 = errors
    Deploy Hibernate based EAR file on Weblogic 10.3.3?
    OTN Post: Default JPA provider for Weblogic Server 10.3.2 (11g) - updated
    Default JPA provider for Weblogic Server 10.3.2 (11g)
    OTN Post: Hibernate 3.6 Final (JPA 2.0) + WL 10.3.x :Unable to deploy sample appn - updated
    Hibernate 3.6 Final (JPA 2.0) + WL 10.3.x :Unable to deploy sample appn
    WebLogic 10.0 + JPA 2.0 = errors
    OTN Post: EJB with Hibernate On Weblogic - updated
    Re: EJB with Hibernate On Weblogic
    OTN Post: OEPE 1.6 - Oracle WebLogic Server 11gR1 PatchSet 3 requres WLS 10.3.4 - answered
    OEPE 1.6 - Oracle WebLogic Server 11gR1 PatchSet 3 requres WLS 10.3.4
    OTN Post: EJB with Hibernate On Weblogic - updated
    Re: EJB with Hibernate On Weblogic
    OTN Post: OpenJPA_2.0 NoSuchMethod error (getValidationMode()) - updated
    OpenJPA_2.0 NoSuchMethod error (getValidationMode())
    JPA 2.0 features used on WebLogic even if they are not available at runtime - notified
    http://netbeans.org/bugzilla/show_bug.cgi?id=189205
    Option to enable JPA 2.0 for dev WebLogic - notified
    http://netbeans.org/bugzilla/show_bug.cgi?id=189348
    False-positive error badge on project with JPA targeting WebLogic - notified
    http://netbeans.org/bugzilla/show_bug.cgi?id=189626
    Giving up on Hibernate (for now), trying EclipseLink...
    http://forums.netbeans.org/post-94817.html
    http://blogs.sun.com/arungupta/entry/which_java_ee_6_app
    Eclipselink 2.0 + WebLogic 10 => No joy (Unable to get Eclipse link 2.0 working with WebLogic 10) - answered
    http://www.eclipse.org/forums/index.php?t=msg&goto=644000&S=40e13288641c0af5dc8489343b896348#msg_644000
    eclipselink-users Problem of eclipselink upgrade (2.0.2) - WebLogic 10.3.3.0 - answered
    http://dev.eclipse.org/mhonarc/lists/eclipselink-users/msg04631.html
    Re: EclipseLink + JPA 2 in Weblogic 10.3.0
    http://dev.eclipse.org/mhonarc/lists/eclipselink-users/msg04375.html - answered below
    Re: eclipselink-users Problems with Eclipselink 2 (JPA 2.0) & WebLogic 10,
    http://dev.eclipse.org/mhonarc/lists/eclipselink-users/msg05609.html
    [eclipselink-users] Problems with Eclipselink 2 (JPA 2.0) & WebLogic 10 - answered
    http://dev.eclipse.org/mhonarc/lists/eclipselink-users/msg05639.html
    To be Deprecated
    JPA 2: Reverify JPA 2.0 XSD support in persistence.xml on AM/CM app on WebLogic 10.3.3.0
    http://bugs.eclipse.org/331569
    JPA 2.0: Add WebLogic 10.3 configuration process to enable the JPA 2.0 library functionality
    http://bugs.eclipse.org/296271
    WebLogic 10.3 availability?
    / Michael O'Brien
    http://www.eclipselink.org

  • Static Class JMS Listener

    I am designing an EJB component (MessageDrivenBean) that requires
    dynamic ("hot") configuration changes. As such, the bean must be
    notified somehow of configuration changes in the DB (rather than have
    to poll the DB for changes at every method call).
    I'm thinking of implementing this functionality using a static class
    instance (singleton) that is shared between the multiple instances of
    the bean. This static instance would listen on a JMS topic for
    configuration change events and update its internal cache accordingly
    (by getting the configuration information from the DB). The beans
    would then access this in-memory static instance everytime they need
    configuration info instead of polling the database. By using the JMS
    topic, I guarantee that clustered instances of Weblogic will all be
    notified of the database changes (each instance would have its own
    "cache" singleton).
    I'm pretty sure all of this will work, but I'm equally sure that I'm
    violating some EJB rules. Singletons and JMS listeners are generally
    discouraged. Are there any alternatives to this design?

    Hi Joost,
    This all seems to be pretty complicated. Not to mention that you can not
    guarantee that members of a cluster will be notified simultaneously.
    Why don't you want using the database?
    "Joost Ouwerkerk" <[email protected]> wrote in message
    news:[email protected]..
    I am designing an EJB component (MessageDrivenBean) that requires
    dynamic ("hot") configuration changes. As such, the bean must be
    notified somehow of configuration changes in the DB (rather than have
    to poll the DB for changes at every method call).
    I'm thinking of implementing this functionality using a static class
    instance (singleton) that is shared between the multiple instances of
    the bean. This static instance would listen on a JMS topic for
    configuration change events and update its internal cache accordingly
    (by getting the configuration information from the DB). The beans
    would then access this in-memory static instance everytime they need
    configuration info instead of polling the database. By using the JMS
    topic, I guarantee that clustered instances of Weblogic will all be
    notified of the database changes (each instance would have its own
    "cache" singleton).
    I'm pretty sure all of this will work, but I'm equally sure that I'm
    violating some EJB rules. Singletons and JMS listeners are generally
    discouraged. Are there any alternatives to this design?Regards,
    Slava Imeshev

  • Session sharing across web applications in an EAR File

    Hi,
    I have an ear file which further has 5 war files. I want to share the same session
    object across all these war files in the ear file. Can u pls tell me if this is
    possible in weblogic. If yes how?
    Thanks,
    Akash

    I'm sorry, by the J2EE 1.3 specification this isn't allowed. I have sent it on
    to the servlet team to add as an option but that won't be in time for you. If
    you need to share state between them I would probably try and put it in another
    place like an EJB or a singleton class in the system classpath.
    Sam
    [email protected] wrote:
    Hi,
    I have an ear file which further has 5 war files. I want to share the same session
    object across all these war files in the ear file. Can u pls tell me if this is
    possible in weblogic. If yes how?
    Thanks,
    Akash

  • Non-sequential IDs assigned using sequence="ID" on PrimaryKey

    Hello,
    I've seen some people asking something similar but I can't get this thing to work and it's driving me crazy. I'm using je-3.2.23 BTW.
    I have this simple class:
    * SYSADM.java
    * Created on 26 de junio de 2007, 09:29 AM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package haven;
    import com.sleepycat.persist.model.Entity;
    import com.sleepycat.persist.model.PrimaryKey;
    * @author Mario
    @Entity
    public class SYSADM extends Usuario{
    private boolean root;
    @PrimaryKey(sequence="ID")
    private long id;
    /** Creates a new instance of SYSADM */
    public SYSADM() {
    /** Creates a new instance of SYSADM from parameters */
    public SYSADM(boolean root,long id, String loginName, String password, String nombre, String apellido, String email) {
    super(loginName, password, nombre, apellido, email);
    setRoot(root);
    //setId(id);
    /** Creates a new instance of SYSADM from a VOSYADM */
    public SYSADM(VOSYSADM voSYSADM) {
    super(voSYSADM.getLoginName(),voSYSADM.getPassword(),
    voSYSADM.getNombre(),voSYSADM.getApellido(),voSYSADM.getEmail());
    setRoot(voSYSADM.isRoot());
    //setId(voSYSADM.getId());
    public VOSYSADM getVOSYSADM() {
    return new VOSYSADM(this.isRoot(),this.getId(),this.getLoginName(),this.getPassword(),
    this.getNombre(),this.getApellido(),this.getEmail());
    public boolean isRoot() {
    return root;
    public void setRoot(boolean root) {
    this.root = root;
    public long getId() {
    return id;
    public void setId(long id) {
    this.id = id;
    and when I add records to the database using DPL I get ids like 1,101,201... and so on.
    I've looked at all the examples and tested them myself and I get the same behavior from all the classes I test.
    Plus all the tutorials and materials say that this is plain simple... let me quote from PrimaryIndex:
    " Employee employee;
    employee = new Employee("Jane Smith");
    primaryIndex.putNoReturn(employee); // Inserts an entity
    assert employee.id == 1;
    employee = new Employee("Joan Smith");
    primaryIndex.putNoReturn(employee); // Inserts an entity
    assert employee.id == 2; "
    I don't get... may be I'm plain dumb... should've ask that first to myself... I'm getting desperate here people... really!
    Anyway... any help is much appreciated.
    Regards to all,
    Mario

    First of all many thanks for your feedback... it's
    really encouraging in times of desperation to find
    somebody out willing and actually helping you! You're welcome!
    This is good. I'm aware of how RDBMS are integrated
    in the AS. Basically you need the driver and the
    connection to the database. For DBD JE I have made a
    simple test and I can persist objects from a web
    application in the AS. I simply open the environment
    that points to a directory in the file system. I
    suppose that as long as that directory is accessible
    through the network it should be fine. Is this
    correct?That''s correct. However, I strongly recommend that the Environment directory be on a local disk. There are problems with using NFS, see:
    http://www.oracle.com/technology/products/berkeley-db/faq/je_faq.html#1
    The question of scalability arises. As far as I read
    DBD C is the number one embeddable OpenSource
    Database out there. So I assume the same would apply
    for BDB JE some day (more even once it gets HA). How
    scalable is BDB JE? The limitation seems to be the
    available space in the machine where the filesystem
    is located? Does the filesystem have to the same
    where the AS is installed?It sounds like you're asking about data size scalability, not processor scalability. Yes, the limitation is the amount of file storage available, via a single directory, from the process that embeds JE. JE uses the standard java.io package for creating and accessing log files, so any hardware and file system that works under that API will work, as long as file locking is supported as mentioned in the FAQ above. JE creates numbered log files in sequence from 00000000.jdb to FFFFFFFF.jdb, and you can configure the size of the files. The default size is 10 MB.
    Ok I 'll look into it. Specialy into what a "Service"
    is. Off the top of my head I guess that by service
    you are referring to a stateless ejb implementing the
    Singleton pattern so you have only one instance
    running at all times, that embeds all database
    interactions, opens the environment at creation time,
    give data-accessors and thus handles all access to
    the database. Exactly.
    Should I open all indexes in the
    Singleton at creation time as well and simply get
    data-accessors to to perform read/write operations?Yes, that's what I recommend. See:
    http://www.oracle.com/technology/products/berkeley-db/faq/je_faq.html#12
    Ok we willhave to wait then. One of the questions I
    received about BDB JE is why a JE when you have the C
    version with a Java API? I guess it's related to
    being written in Java (portability-wise), it runs in
    the same JVM and it's 100% Java codeYes, this is the primary reason. A pure Java library is easier to deploy, test and debug than a C-based library, especially if you target multiple platforms. And the product can be optimized for the Java platform.
    and that it
    incorporates the DPL much in the way JPA works to
    have a closer integration. Am I correct?The DPL is only available for the JE product today, but it may be available for the C product in the future, since it is implemented on top of the base Java API that is common to both products.
    Also, while the JE product has similar functionality to the C product, it uses a different internal architecture. JE uses a log structured storage system rather than a traditional page-based storage system; this is better for writing (disk head moves less) but worse for fetching records that are not in cache (disk head moves more). JE also uses record locking rather than page locking; this improves concurrent access but uses more memory for locks.
    See "Berkeley DB Java Edition Architecture" here:
    http://www.oracle.com/technology/products/berkeley-db/je/index.html
    Last but not least. Portability-wise we are using DAO
    to persist and in the DAOs we perisist the objects.
    My logic is that by decorating POJOs with BDB JE
    annotations i can use DAO to persist in DB JE, any
    other persistency type including text, dbf, RDBMs
    using an ORM (without JPA), or creating a separate
    set of classes decorated with JPA annotations (though
    I would stick with ANSI SQL if I could). Do you see
    this as correct? Would you reccomend using DAO at all
    with Berkeley?Yes, a DAO is a good idea when you need to target multiple storage mechanisms. And the DPL does not meet this need, because it can only be used for Berkeley DB JE.
    If you need an API that works very well for Berkeley DB (JE and C products), plus relational DBs, then I strongly recommend Carbonado, an open-source framework from Amazon:
    http://carbonado.sourceforge.net/
    Mark

Maybe you are looking for

  • Gr / ir open balance

    Dear friends,                    I have done one report on GR (good receipt ) incompleted against IR( invoice ).                    GR is done but IR in not done. display this GR in Report.                    using LFBNR  reference document field in

  • How can i watch an itunes purchased movie on my regular tv?

    I purchased a few movies on Itunes store. I would like to watch those on my regular TV. How would I do this?

  • What Mac to get for Final Cut Studio?

    I've been doing most of my video editing for the last year or so in Sony Vegas on a PC. I'm looking to get into it a bit more seriously and want to make the switch to Final Cut Studio. Can I run it on a Macbook Pro? Can I run it WELL on a Macbook Pro

  • Labview 8 with applicatio​n with MatScript node hangs

    Hi, I have a application build with Labview 7 adapted with Labview 8, more specifivaly I included a MathScript node. It works just fine in the development environment. But the compiled exe hangs when it starts with code in the Mathscript node. Anyone

  • Where to keep new OA page(RN.XML in oracle Application Directory structure?

    I have created a new XML region which I want to use in page through Personalization. where should I copy this file into Application Directory structure? I am using this command to import - import C:\OA\jdevhome\jdev\myprojects\xbol\oracle\apps\ota\ad