Persistence from the container's perspective

I've read up on using [JPA in a desktop application|http://java.sun.com/developer/technicalArticles/J2SE/Desktop/persistenceapi/] , but does anyone have a clue as to how a typical EJB container instantiates an EntityManager? I'm creating a toy EJB container, and the problem I'm running into appears to be a lack of "persistence.xml". Specifically, persistence.xml should live within a library .ear, I should read the values from that file, put them in a Properties instance, and finally call "Persistence.createEntityManagerFactory" in order to create a resource to be injected. However, when I try this, I am getting the error: "javax.persistence.PersistenceException: No Persistence provider for EntityManager named default". I am guessing this is because my container (which has no persistence.xml of its own) does not have the PU entry in a persistence.xml within its own scope. Does anyone out there have some insight as to how this process actually works in the real world? Any help would be greatly appreciated.

The container would not have a persistence.xml file of its own.
It's the applications being run by the container that would provide the persistence.xml file inside the META-INF of an ejb-jar file.
The file would point to an implementation of JPA as the persistence provider.
If you are making an EJB container then you should separate that from a persistence implementation.
What you want to look for is how to read user provided persistence.xml files to find out their persistence implementations which should have been provided to your container buy the users themselves.

Similar Messages

  • MDM Administration from the SAP Basis perspective.

    Hi MDM Experts,
    I am sap basis administrator and now i need to administer SAP MDM. I need to know what are the things that SAP Basis administrator needs to know to administer SAP MDM from the SAP Basis perspective?
    It would be great if somebody can give a list of things that BASIS guy must know if he has to administer SAP MDM systems.
    Thanks
    Deepak

    Hi Deepak,
    I need to know what are the things that SAP Basis administrator needs to know to administer SAP MDM from the SAP Basis perspective?It would be great if somebody can give a list of things that BASIS guy must know if he has to administer SAP MDM systems.
    Please go through Console guide which covers most of basis activities.
    I am listing down links to guides which can help you administer :
    After skimming through the functionality part of Console guide,you can go through this guide for Administration Cockpit,this also contains activity level details:
    http://help.sap.com/saphelp_smehp1/helpdata/en/e7/73b1d173df4696b38b02cad160cdda/frameset.htm
    You can go though this very useful document on MDM administration:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/1041a80a-f462-2c10-3ab3-9acb03bdb816?QuickLink=index&overridelayout=true
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70c286a6-0375-2c10-bfbb-e6e83d72d804?QuickLink=index&overridelayout=true
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0d7aa25-7c8a-2c10-eeb1-a15bbfa7ee63?QuickLink=index&overridelayout=true
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/1089e1f2-8f94-2c10-fca9-e8fc697aadff?QuickLink=index&overridelayout=true
    For monitoring of inbound files:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30aa4934-cc63-2c10-0491-d312a106f716?QuickLink=index&overridelayout=true
    For further details refer to the MDM documentation as prescribed in above post.
    Thanks,
    Ravi

  • [svn] 4694: Don't remove text lines from the container if it isn' t the container the lines were added to.

    Revision: 4694
    Author: [email protected]
    Date: 2009-01-27 14:35:21 -0800 (Tue, 27 Jan 2009)
    Log Message:
    Don't remove text lines from the container if it isn't the container the lines were added to. When there is a state change the displayObject can be switched out from under the TextGraphic and TextBox.
    QE Notes: need to add tests - will attach my test program to bug
    Doc Notes:
    Bugs: SDK-18923
    Reviewers: Gordon
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-18923
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/TextBlockCompose r.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/TextFlowComposer .as

    Yup, you guys pointed me in the right direction.
    I changed my adjustmentListener to the following:
    JScrollBar scrollBar = (JScrollBar) e.getSource();
    int endLoc = document.getLength();
    try {
        Rectangle end = outputArea.modelToView(endLoc);
        if (end != null) {
            int n = scrollBar.getValue() + scrollBar.getVisibleAmount();
            boolean locked = (end.y >= n && n <= (end.y + end.height));
    } catch (BadLocationException ex) {
    }By comparing scrollbar position with the visible rectangle of the end of the document, I can now easily tell if the user has moved the tracker back or not.
    To go to the next step of automatically pausing scrolling whenever the user is moving the slider back, I also had to disable the automatic scrolling performed by DefaultCaret. Because there was no way to tell if the user was scrolling or if the output was adjusting from the adjustmentListener, I also had to flag whenever I was autoscrolling.
    The end result is a JTextPane that can be appended to at all, and locked by the user by using the slider. If new data arrives, the window is not scrolled, and any text selection the user has is not cleared. Perfect!

  • Article Quality Question: Writing from the 1st person perspective

    Hi guys,
    Hope that you all had a good festive break.  I've got a question for any of the TechNet Quality control group when they're around.  It's relating to article perspective.
    I've started an article series regarding CodePlex products for SharePoint (on this
    link) and have in the past removed any first person perspectives as to make it as general as possible.  It later struck me that this is somewhat misaligned as any review article is going to be viewed through the experience of the guy playing with the
    goods.
    So, whilst I appreciate that the TechNet wiki is mostly full of technical How to do and best practice guides, I'm wanting to add a different type of article to the wiki that can be referred too when people perhaps see that a CodePlex project doesn't have
    a great deal of literature.
    My question is, on that basis, would it be acceptable for me to write in a first person perspective just for these articles?
    Many thanks,
    Steven
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

    Hi Richard
    I've seem some wiki article authors use them, but that's only typically when the article has been rushed or not formatted properly.  I'm not against removing it entirely but just wanted to check in.
    Thanks for your response.
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • Do I need to worry about these event handlers in a grid from a memory leak perspective?

    I'm pretty new to Flex and coudn't figure out how to add event handlers to inline item renderer components from the containing file script so I attached the listnerers simply as part of the components themselves (eg <mx:Checkbox ... chnage="outerDocument.doSomething(event)"../>):
    <mx:DataGrid id="targetsGrid" width="100%" height="100%" doubleClickEnabled="true" styleName="itemCell"
          headerStyleName="headerRow" dataProvider="{targets}"
          rowHeight="19" fontSize="11" paddingBottom="0" paddingTop="1">
         <mx:columns>
         <mx:DataGridColumn width="78" dataField="@isSelected" headerText="">
         <mx:itemRenderer>
              <mx:Component>
                   <mx:HBox width="100%" height="100%" horizontalAlign="center">
                        <mx:CheckBox id="targetCheckBox" selected="{data.@isSelected == 'true'}"
                             change="outerDocument.checkChangeHandler(event);"/>
                        <mx:Image horizontalAlign="center" toolTip="Delete" source="@Embed('/assets/icons/delete.png')" useHandCursor="true" buttonMode="true"
                             click="outerDocument.deleteHandler(event);"/>
                        <mx:Image id="editButton" horizontalAlign="center" toolTip="Edit" source="@Embed('/assets/icons/edit-icon.png')" useHandCursor="true" buttonMode="true"
                             click="outerDocument.editHandler(event);"/>
                   </mx:HBox>
              </mx:Component>
         </mx:itemRenderer>
         </mx:DataGridColumn>
              <mx:DataGridColumn id="Name" dataField="@collectionDesc" headerText="Name" itemRenderer="com.foobar.integrated.media.ui.component.CellStyleForTargetName"/>
              <mx:DataGridColumn id="Created" width="140" dataField="@createDateTime" headerText="Created"  labelFunction="UiHelper.gridDateFormat" />
         </mx:columns>
    </mx:DataGrid>
    This grid is part of a view that will get destroyed and recreated potentially many times during a user's session within the application (there's a large dynamic nature to the app and views are created at run-time.) By destroyed I mean that the view that holds the above datagrid will no longer be referenced under certain circumstances and an entire new view object is created (meaning the old datagrid is no longer refernced and a new one is created.)
    I heard you should clean up event handlers when they are no longer used, and I know at what point the view is destroyed, but I don't know how to clean up the event handlers added to the item renderer components? Is it something that the Flex garbage collector will handle efficiently?
    Also, on a somewhat related note, how could I push the item renderer to an external component since in my event handlers for the item renderer buttons I need a reference to the datagrid.selectedIndex which, as an external item renderer I wouldn't have access to this containing grid?

    No. You don't need explicit cleanup in this case: if your outerDocument is going away, you have nothing to worry about. The event handler leak can happen in sort of the reverse situation: suppose you have a long-lived MyView that contains a custom DataGrid like the one below. Now suppose that MyView frequently destroys and re-creates the grid. And suppose that on its creationComplete event, the grid registers a listener for outerDocument's (MyView's) enterFrame Event. Unless you explicitly remove this listener, MyView will still have a reference to it even after the grid that registered the listener is destroyed (and garbage collected).
    This is a pretty contrived example, but it sort of illustrates the potential for leaks: a certain component is elligible for garbage collection, but some longer-lived component holds a reference to it (or part of it, such as a listener function). If the longer-lived component is elligible for GC as well, you don't really need to worry about proper cleanup. That's what you're paying the GC processor cycles for.

  • How to refresh the container

    Hi,
    I have developed a user interface. A JScrollPane is a part of it and the JSP has a JTree in it. During the run time I am trying to remove the JSP from the container by this method:
    jsp.getViewport().remove(myTree);
    //Container content;
    content.remove(jsp);
    The problem is that i still see the JSP and its content (JTree) after the execution of the method. If I minimise the application and maximise it again I see that the JSP disappeared.
    What is the reason for this?
    Do I need something like refresh?
    Thanks

    invalidate()
    refresh()

  • Exporting XML from a container

    Getting XML documents into an XmlContainer seems easy enough, but how do I get them back out again into XML? I don't see anything in API that will export the documents once they're placed in the containers.
    The reason I'd like to do this is to use BDB XML with a source-control system. Basically, each user would check out a bunch of XML files from source control and create a local container. As changes to the XML files get checked in, they would update and re-add the changed XML files to their local container. When they make changes to their local xml data, I'd like to programmatically determine which documents changed (that part I can do myself) and then export those "edited" documents from the container back into XML format. Then the users can check in their changed documents.
    This seems like it would work except that there's no way to export XML documents once they're placed in the XmlContainer. I suppose I could write my own exporter without great difficulty, but it seems like such a basic thing that I feel like I must be missing something somewhere.
    Is there really no built-in export-to-xml capability?

    Hi Devnull,
    Getting XML documents into an XmlContainer seems easy
    enough, but how do I get them back out again into
    XML? I don't see anything in API that will export
    the documents once they're placed in the containers.If you want to export all the documents held by a container you can simply use the dbxml shell:
    dbxml>getDocuments
    dbxml>print >container_name.xml
    This seems like it would work except that there's no
    way to export XML documents once they're placed in
    the XmlContainer. I suppose I could write my own
    exporter without great difficulty, but it seems like
    such a basic thing that I feel like I must be missing
    something somewhere.Not quite sure if you want to export each document from the container in its own individual xml file or all the documents in a single xml file (if this is the case use the suggested shell commands, or implement it programmatically).
    A couple of methods that you could use to implement the exporting functionality that you desire are:
    o XmlContainer::getAllDocuments http://www.oracle.com/technology/documentation/berkeley-db/xml/api_cxx/XmlContainer_getAllDocuments.html
    -> using this method you could retrieve all the documents inside an xml container, as an xml result set
    o XmlResults::next
    http://www.oracle.com/technology/documentation/berkeley-db/xml/api_cxx/XmlResults_next.html
    -> use this method to iterate through the result set and get each document
    o XmlDocument::getContent
    http://www.oracle.com/technology/documentation/berkeley-db/xml/api_cxx/XmlDocument_getContent.html
    -> use this method to put the content of an xml document from the result set in a string; you could write it into an individual xml file or append it to a single xml file
    Regards,
    Andrei Costache
    Berkeley DB
    Oracle Support Services

  • JPA - the container - persistence.xml file

    Hi,
    I'm just starting out with JPA so these are basic questions.
    Firstly, this is what I've done:
    1) Created JPA entities from tables
    2) I've used JDeveloper to create a Java Service Facade using the wizards.
    3) Created a persistence unit and added the JPA entities to this.
    The resulting persistence.xml is in a project with only JPA stuff in it (in META-INF).
    The project which is run (some EJB 2.0 session beans and message driven beans, all specified in the ejb-jar.xml) has the JPA's projects classpath on its classpath.
    The JPA code itself accesses the entity manager programatically i.e. it does not make use of any J2EE container services.
    My question is:
    Are my JPA entities fully fledged EJB 3.0 entities i.e. are they being managed by the container? I'm accessing the JPA entities in a J2SE way, they just happen to be running within a J2EE container.

    Are my JPA entities fully fledged EJB 3.0 entities
    i.e. are they being managed by the container? I'm
    accessing the JPA entities in a J2SE way, they just
    happen to be running within a J2EE container.The meaning of "managed" for Entities has changed from EJB 2 to 3. In JPA, Entities are managed by a Persistence Provider and not by the container per se. This is why you can have a managed Entity in a Java SE environment.
    But to answer your question, yes your classes are full fledged JPA Entities if read through, merged, or persisted with an EntityManager. You can find out more about the JPA definition of "managed" in section 3.2 of the JPA Spec.
    --Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • HT2674 I have an iMac purchased in May 2011.  OSX Lion 10.7.3.  I deleted backup file from the external hard drive. Now, the trash can will not empty some of the files deleted.  File folder: "Core Services" contains a locked file: "boot.efi".  It will not

    I have an iMac purchased in May 2011.  OSX Lion 10.7.3.  I deleted backup file from the external hard drive which operates from Time Machine.
    Now, the trash can will not empty some of the files deleted from the backup harddrive.
    The trash contains-- File folder: "Core Services" which contains a locked file: "boot.efi". 
    It will not delete.
    How do I get the trash can empty of these files?

    Yes, the Old Master file has a folder for each year where I find all photos from that specific year. I am attaching a screen shot of the file.
    In the meantime i have managed to download all photos (it did not download any video files though in mpg, avi, 3gp, m4v,mp4 and mov format) to a new iphoto library. Unfortunately the photos are quite mixed and often doubled up. I ma considering to purchase iphoto library which checks all duplicates in iphoto. this will save me a lot of time. What do you think?

  • HT4910 My iCloud contact list does not contain all the contacts that are in my phone.  If I delete one from my phone it will delete it instantly from the iCloud contacts.  But how do I get all those other contacts on my phone to the iCould on my Windows c

    My iCloud contact list does not contain all the contacts listed in my iPhone 5S.  If I delete a contact from the phone it instantly deletes it from the iCloud on my PC.  But my PC iCloud list is lacking many of the contacts on my phone.

    And which account did you enter these contacts in?
    On My Mac
    or
    iCloud?

  • The DNS server has encountered a critical error from the Active Directory. Check that the Active Directory is functioning properly. The extended error debug information (which may be empty) is "". The event data contains the error.

    got event ID 4015 and source DNS-Server-Service. please suggest how to fix this issue
    The DNS server has encountered a critical error from the Active Directory. Check that the Active Directory is functioning properly. The extended error debug information (which may be empty) is "". The event data contains the error.
    Raj

    Hi
     first run "ipconfig /flushdns" and then "ipconfig /registerdns" finally restart dns service and check the situation,also you can check dns logs computer management ->Event viewer->Custom Views->Server roles->DNS.

  • Error message from the source system, Caller 09 contains an error message.

    Hi,
        Guru's, i got an error massage when my process chain is running(Daily) in BIW 7.0, the error got in Data Loading from source to PSA or data targets. The errors having the below details
    Error message from the source system
    Diagnosis
    An error occurred in the source system.
    System Response
    Caller 09 contains an error message.
    Further analysis:
    The error occurred in Extractor .
    Refer to the error message.
    Procedure
    How you remove the error depends on the error message.
    Note
    If the source system is a Client Workstation, then it is possible that the file that you wanted to load was being edited at the time of the data request. Make sure that the file is in the specified directory, that it is not being processed at the moment, and restart the request.   "
    Can any body help me out of this situation what to do and how to resolv ethe problem.
    Thanks and Regards,.
    Taps....

    Caller 09 is a very common issue - please search the forums before posting....
    Arun

  • Everytime I try to update to iOS5 on my iPhone 4 I get an error containing 0xE while it is trying to backup data from the iPhone.  I have done everything suggested in Apple support.  How can I upgrade to iOS5 without losing all the data on my phone?

    Everytime I try to update to iOS5 on my iPhone 4 I get an error containing 0xE while it is backing up data from the iPhone before installing the new operating system.  I have done everything suggested in Apple support with no success.  I still get the error everytime (about 5 minutes into backing up iPhone data).  How can I upgrade to iOS5 without losing all the data on my iPhone (the error message says that if I continue I will lose all data on the phone)?  If I have already synced the phone before upgrading the OS, would I be able to restore my data after installing the new OS by syncing after the OS upgrade is complete?  Any help would be greatly appreciated. 

    I had the same problem today and was able to resolve it without having to do a restore or reset. The problem had something to do with my mail accounts. The upgrade reset my mail settings, switching both my gmail and my .mac mail to "archive all mail". I went into the General Settings, disabled that setting, and resynced the phone. The "other" storage allottment dropped back down to less than a gig.
    Before you restore or reset, I would try that first.

  • Credit Memo DFF does not contain information from the original invoice line

    Hi
    Customer is facing issue mentioned in Note: 364999.1
    Issue: Created a credit memo against the invoice and noticed that the resulting credit memo lines do not contain the DFF information from the original invoice lines.
    I found through Metalink that this issue was reported to Oracle for release 11.5.7.
    Looks like the fix was to provide a check box in RAXSUMSC.fmb.
    - One off Patch for 11.5.7 - Bug / Patch 2803629 (one-off patch)
    - One off Patch for 11.5.8 - Bug / Patch 3411221 (one-off patch)
    - 11.5.9 - nothing available !!!!
    As per bug 2675652 the issue was fixed in a file RAXSUMSC.fmb, version 115.41 This BUG shows that it has been fixed by in 11.5.10
    Customer is using 11.5.9 which has RAXSUMSC.fmb, version 115.40, we cant apply patches for 11.5.7 or 11.5.8 that are available.
    Any pointers on what can be done ?
    Thanks,

    Hi Pat,
    the project code (PC) on the marketing document may only be applied to the business partner (BP), hence the only row in the associated journal entry (JE) with this project code is that of the BP.
    You can link project codes to specific accounts (CoA -> select account -> account details -> project code) & this project code will then be assigned every time the account is found in a JE.
    If you require the project code to be applied to the freight, you may assign this project code to the account you have defined for this freight. The drawback is naturally that the project code will then  be pulled every time this freight is used, regardless of whether or not the PC is associated with the BP or not.
    It is possible to manually assign project codes to every row in a journal entry, hence this should also be possible with SDK. You might explore the possibility whether it might be possible to automatically assign the BP PC to all rows in the JE using a script.
    All the best,
    Kerstin

  • How to clear the picture from custom container

    Hi All
    I am uploading the employee image into custom container . for that i have used the below fn modules
    CALL FUNCTION 'HR_IMAGE_EXISTS'
    EXPORTING
    p_pernr = pernr
    * P_TCLAS = 'A'
    * P_BEGDA = '18000101'
    * P_ENDDA = '99991231'
    IMPORTING
    * P_EXISTS =
    p_connect_info = g_connect_info
    EXCEPTIONS
    error_connectiontable = 1
    OTHERS = 2
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    else.
    CALL FUNCTION 'SCMS_DOC_URL_READ'
    EXPORTING
    * MANDT = SY-MANDT
    stor_cat = space
    crep_id = g_connect_info-archiv_id
    doc_id = g_connect_info-arc_doc_id
    * PHIO_ID =
    comp_id = 'DATA'
    * SIGNATURE = 'X'
    * SECURITY = ' '
    * USE_LOCATION = 'A'
    * LOCATION = ' '
    * HTTP_URL_ONLY = ' '
    dp_url_only = 'X'
    * LIFETIME = ' '
    * NO_CACHE = ' '
    * EXPIRATION =
    * PDF_MODE = ' '
    * URL_EXTENTION = ' '
    * FORCE_GET = ' '
    IMPORTING
    url = g_url
    EXCEPTIONS
    error_config = 1
    error_parameter = 2
    error_signature = 3
    http_not_supported = 4
    docget_not_supported = 5
    not_accessable = 6
    data_provider_error = 7
    tree_not_supported = 8
    not_supported = 9
    OTHERS = 10
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    after getting the url for uploading the picture
    I used load_picture_from_url
    the image is uploaded, but when i try to clear the image from control using picture->clear_picture
    it is not clearing the image
    Please help me how to clear the image.
    Thanks
    Rama

    Hi,
    " Request an URL from the data provider by exporting the pic_data.
    CLEAR url.
    PERFORM load_pic_from_db CHANGING url.
    " load picture
    CALL METHOD cl_gui_picture_1->load_picture_from_url
      EXPORTING
        url = url.
    CLEAR url.
    url = 'file://C:\sap-logo.gif'.
    CALL METHOD cl_gui_picture_2->load_picture_from_url
      EXPORTING
        url = url.
    CLEAR url.
    url = 'http://www.sap-press.com/images/logo_books_online_162_50.gif'.
    CALL METHOD cl_gui_picture_3->load_picture_from_url
      EXPORTING
        url = url.
    init = 'X'.
    CALL METHOD cl_gui_cfw=>flush
      EXCEPTIONS
        cntl_system_error = 1
        cntl_error = 2.
    ENDIF.
    Its helpful.
    Regards,
    Raj.

Maybe you are looking for

  • Calendar entries made on iPhone not showing up on mobileme or iCal

    When I add an entry to my calendar on my iPhone, it shows on the iPhone, but not on the iCal or mobileme calendars. When I try to manually sync it, using iTunes, everything on my iPhone calendar disappears and when I restore it, the items I had added

  • Album artwork showing up as separate files.

    I'm transfering my music files to my MacBook Air, and as I browse through them in Finder while on my external hard drive, the album artwork that's on the .mp3 file, is also showing up as a separate .jpeg file. If I have a folder of songs, and in tota

  • Share button doesnt display photo upon arrival

    hey never posted here but dont seem to find it on google so basicallly when i right click (or two finger click) on a picture and click share>email, sends fine and email arrives but picture is not displayed. self trouble shooting= insted of rght click

  • HT3325 Keynote issue

    Please come up with a way to use remote using Bluetooth on a Mac. School wifi systems are locked and hence can't be used to connect devices.

  • N73 (in mass storage mode) and Vista!

    Can someone please help me??? It seems that windows vista can't recognize the phone under mass storage mode... are there any solutions for this problem?