CRUD operations and PersistenceManager close.

I have several issues which I am struggling to find the best practices for
Kodo implementation of JDO. I have a typical database schema.
Employee-Office (one-2-many), Employee-Department(one-2-many),
Employee-Projects (many-2-many).
1. What are best practices to do CRUD operations on Employee table? How
does JDO-QL queries look like? (I am new the JDO).
2. What are the best practices to do close on PM, Query, and Extent? PM
close seems to be tricky. I found a good discussion on this newsgroup
about pm.close(). As it is from 2002, would like to get latest details on
when one could reuse extent, query and pm objects and when one could do
close on them 'safely' and considered best practice?
Thank you.

Vipul-
In article <c2i8u2$7v1$[email protected]>, Vipul Sagare wrote:
>
I have several issues which I am struggling to find the best practices for
Kodo implementation of JDO. I have a typical database schema.
Employee-Office (one-2-many), Employee-Department(one-2-many),
Employee-Projects (many-2-many).
1. What are best practices to do CRUD operations on Employee table? How
does JDO-QL queries look like? (I am new the JDO).I think these sorts of questions are best anwered by running through the
tutorial in the documentation. All the simple operations are
demonstrated.
If you still have questions about this after taking the tutorial, please
let us know.
2. What are the best practices to do close on PM, Query, and Extent? PM
close seems to be tricky. I found a good discussion on this newsgroup
about pm.close(). As it is from 2002, would like to get latest details on
when one could reuse extent, query and pm objects and when one could do
close on them 'safely' and considered best practice?There is some discussion of the effect of closing the PersistenceManager
at:
http://docs.solarmetric.com/manual.html#jdo_overview_pm_closing
Basically, closing a PersistenceManager should be done once you no
longer need to use any of the objects that may have been obtained from
the PersistenceManager. Note that Kodo will close discarded
PersistenceManagers automatically for you eventually, but it is
sometimes wise to do it yourself to conserve resources.
Marc Prud'hommeaux [email protected]
SolarMetric Inc. http://www.solarmetric.com

Similar Messages

  • A msg appears that Firefox is still operating and to close it. However it is not operating. What can I do? It does not show up on the Task Mgr window.

    I had a crash of Firefox and since then I can not open it again. The msg appears that Firefox is already in use; however, I deleted Firefox from my system and tried to download a new version to no avail. I can not install the new version because I get a msg that Firefox is still running. I am using E IE for now and this is causing some problems. I would like to use Firefox but am not certain how to rectify this problem. Reboot did not solve the problem.

    Sounds like Firefox is "hanging at exit". That problem is frequently caused by an Extension or a Plugin. Read all of the following articles.<br /><br />
    #Stop the Firefox process:
    #*[http://kb.mozillazine.org/Kill_application Mozillazine - Kill application]
    #*Windows 7 users click [http://www.techrepublic.com/blog/window-on-windows/reap-the-benefits-of-windows-7s-task-manager/2576 here]
    #*Mac users: http://techheavy.com/2011/02/the-mac-task-manager/
    #Why Firefox may hang:
    #*[http://support.mozilla.com/en-US/kb/Firefox+hangs Firefox hangs] (see Hang at exit)
    #*[http://kb.mozillazine.org/Firefox_hangs Firefox hangs (Mozillazine)] (see Hang at exit and Closing Firefox properly)
    #*[https://support.mozilla.com/en-US/kb/Firefox+is+already+running+but+is+not+responding Firefox is already running but is not responding]
    #Use Firefox Safe Mode to find a problem with an Extension or Plugin:
    #*Don't check anything when entering Safe Mode, just continue
    #*If the problem does not occur in Safe Mode it is probably and Extension or Plugin causing the problem
    #*See:
    #**[[Safe Mode]] and [http://kb.mozillazine.org/Safe_Mode Safe Mode (Mozillazine)]
    #**[http://support.mozilla.com/en-US/kb/Troubleshooting+extensions+and+themes Troubleshooting extensions and themes]
    #**[http://support.mozilla.com/en-US/kb/Troubleshooting+plugins Troubleshooting plugins]
    #**[http://support.mozilla.com/en-US/kb/Basic+Troubleshooting Basic Troubleshooting]
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You should not use IE6 (used to post your question), as it is riddled with security issues. You should upgrade to IE8 on your XP system.
    *http://windows.microsoft.com/en-US/internet-explorer/products/ie-8/system-requirements
    Not related to your question, but...
    You may need to update some plug-ins. Check your plug-ins and update as necessary:
    *Plug-in check: https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    *Adobe Shockwave for Director Netscape plug-in: [https://support.mozilla.com/en-US/kb/Using%20the%20Shockwave%20plugin%20with%20Firefox#w_installing-shockwave Installing ('''''or Updating''''') the Shockwave plugin with Firefox]
    *Adobe PDF Plug-In For Firefox and Netscape: [https://support.mozilla.com/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]
    *Shockwave Flash (Adobe Flash or Flash): [https://support.mozilla.com/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]
    *Next Generation Java Plug-in for Mozilla browsers: [https://support.mozilla.com/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • CRUD Operations using Servlets , SessionBeans and JPA

    Hi
    Please tell me what will be the right approach for doing CRUD operations .
    I have a jsp page with which the user interacts.
    Please tell me the right approach here :
    Option 1 :
    JSP --->Servlet--->SessionBean--->JPA.
    JSP Page submits data to the servlet , the servlet looks up for the SessionBean , and the sessionBean consists of the container EntityManager , for persist , delete , and finding .
    Option 2 :
    JSP --->Servlet-->JPA.
    The Jsp page submits to servlets and the Servlet itself consists of the container EntityManager , for persist , delete , and finding .

    Depends on the reusabiltity of the query really. If you have a single database query that is used in multiple places, then by all means put it in a session bean. But if you only do persist/delete operations, then just use the EntityManager directly. The session bean would just be an extra layer of complexity that you don't need.

  • HT201412 I just tried to upload the new operating system for my I phone 4s , I get to the terms and conditions, when touch "agree" it opens up and I touch agree again  and it closes and nothing more happens

    I just tried to upload the new operating system for my I phone 4s , I get to the terms and conditions, when touch "agree" it opens up and I touch agree again  and it closes and nothing more happens

    Reset and start all over again.
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.

  • I have Adobe Photoshop CS2 and it closes down every time I open it.

    I have Adobe Photoshop CS2 and it closes down every time I open it with the following error: "Photoshop Quit Unexpectedly". Is there anything I can do to troubleshoot this?

    The first question is have you used this version on this computer with the operating system you have now. The issue might be (if you are on a Mac) that CS2 was a Power PC application and you have upgraded to a new computer with an Intel processor. CS2 will not work on an Intel processor with system (I think) OSX.6 or greater.
    If you have used this release on this computer with the same OS, than try deleting the preferences by holding down the Comand/Control-Option-Shift keys when starting the application. You will get a message asking if you want to delete the preferences, say yes.
    Let me know if any of these work.

  • How to use tree tables with CRUD operation for begineers ADF 11g

    This is Friday night call for help.
    This is only few sample ressources on the web for tree table and only one with CRUD operation.
    I used this one http://jobinesh.blogspot.com/2010/05/crud-operations-on-tree-table.html because this is the only one that address CRUD.
    And it is shaky. Deletion works fine but insertion not very well. This is working using custom code provided below.
    Depending if the user selection in the tree, the code insert from the master node to the children node.
    Any other options because it is not working well.
    Also where Oracle describes how to use the row, rowset, itorator API? This is really hard to understand like almost if we should not use it.
    then if not how can I insert in tree with two nodes and insert in the parent or children depending the users selection.
    Lately I 'been posting questions on this forum with no response. This hurts. I understand developers cannot spend their time on this but People from Oracle, please help. We pay licenses...
    public void createChildren(RowIterator ri, Key selectedNodeKey) {
    final String deptViewDefName = "model.DepartmentsView";
    final String empViewDefName = "model.EmployeesView";
    if (ri != null && selectedNodeKey != null) {
    Row last = ri.last();
    Key lastRowKey = last.getKey();
    // if the select row is not the last row in the row iterator...
    Row[] found = ri.findByKey(selectedNodeKey, 1);
    if (found != null && found.length == 1) {
    Row foundRow = found[0];
    String nodeDefname =
    foundRow.getStructureDef().getDefFullName();
    if (nodeDefname.equals(deptViewDefName)) {
    RowSet parents =
    (RowSet)foundRow.getAttribute("EmployeesView");
    Row childrow = parents.createRow();
    parents.insertRow(childrow);
    } else {
    RowSet parents =
    (RowSet)foundRow.getAttribute("EmployeesView");
    Row childrow = parents.createRow();
    childrow.setAttribute("DepartmentId",
    foundRow.getAttribute("DepartmentId"));
    parents.insertRow(childrow);
    } else {
    System.out.println("Node not Found for " + selectedNodeKey);
    }

    I am looking for a sample that describe how to design a jsf page with a tree table.
    So you have Department and employees. In the tree first comes Department and if you click the node you see the employees assigned to this department.
    I need to be able to insert a new department or a new employee from the tree table by clicking on a insert button in the panel collection toolbar depending on user selection in the tree.
    I got part of it working but not good enough.
    By problem is the get insertion working
    I have a createChildren method in my AM implementation that get in input a RowIterator and selected node key.
    To goal is to create new records depending of the user selection and the input parameters get populated by the binding like this:
    #{backing_treeSampleBean.selectedNodeRowIterator} #{backing_TreeSampleBean.selectedNodeRowkey} via method binding with parameters.
    Is it the right approach?
    First to be able to insert a parent record, I select nothing in the tree and ri and selectedNodeKey comes to null
    we run this code
    ViewObjectImpl vo = getSchHolidaySchedExceptionsView1();
    //ViewObjectImpl vo = getDepartmentsView1();
    Row foundRow = vo.first();
    Row childrow = vo.createRow();
    vo.insertRow(childrow);
    A new blank entry appears in the parent node and we enter a value.
    The the problem starts when we want to add a child to this parent.
    We select the created parent and press the insert button, this code get executed
    if (nodeDefname.equals(deptViewDefName))
    //list of the children of the parent and create an new row
    RowSet childRows = (RowSet)foundRow.getAttribute("SchHolidayExceptionDatesView");
    Row childrow = childRows.createRow();
    childRows.insertRow(childrow);
    But the new entry does not appear, it is almost like it would be created for a different parent because this is a mandatory field that is not feel in yet and the interface complaints of a missing value. It is created somewhere just not a the right place... This is my guess.
    Do you see something wrong with the code?
    The full code og my create children method is there below
    I am using jdeveloper 11.1.1.3.0 any issues with tree table to know about with this version?
    Thanks for your help
    public void createChildren(RowIterator ri, Key selectedNodeKey) {
    final String deptViewDefName = "com.bcferries.app.pdfroutesched.model.SchHolidaySchedExceptionsView";
    final String empViewDefName = "com.bcferries.app.pdfroutesched.model.SchHolidayExceptionDatesView";
    if (ri != null && selectedNodeKey != null) {
    // last row
    Row last = ri.last();
    Key lastRowKey = last.getKey();
    // if the select row is not the last row in the row iterator...
    Row[] found = ri.findByKey(selectedNodeKey, 1);
    if (found != null && found.length == 1) {
    // foundRow is the row selected
    Row foundRow = found[0];
    // The row selected can be the parent node or the child node
    String nodeDefname = foundRow.getStructureDef().getDefFullName();
    // if parent row
    if (nodeDefname.equals(deptViewDefName))
    //list of the children of the parent and create an new row
    //works but we try to resolve the creation of a parent
    RowSet childRows = (RowSet)foundRow.getAttribute("SchHolidayExceptionDatesView");
    Row childrow = childRows.createRow();
    //childrow.setAttribute("HolidayDate", new java.util.Date().getDate());
    System.out.println("insert child row from master");
    childRows.insertRow(childrow);
    } else
    //RowSet ParentRow = (RowSet)foundRow.getAttribute("SchHolidaySchedExceptionsView");
    //RowSet childRows = (RowSet)ParentRow.first().getAttribute("SchHolidayExceptionDatesView");
    Row childrow = ri.createRow();
    System.out.println("insert child row from child ");
    } else {
    System.out.println("Node not Found for " + selectedNodeKey);
    } else {
    System.out.println(" param null try creating for first row : " +
    ri + " * " + selectedNodeKey);
    ViewObjectImpl vo = getSchHolidaySchedExceptionsView1();
    Row foundRow = vo.first();
    Row childrow = vo.createRow();
    vo.insertRow(childrow);
    }

  • Since I updated Firefox I have to constantly re log-in to my Yahoo account such as email. Every time I leave the page I have to log-in to get back into it. I also run OPERA and I do not have that problem with them. I stay logged in. Any suggestions?

    I have windows Vista and have the updated version of Firefox. I also can run OPERA and LUNASCAPE with no problems. When running Firefox I have to constant re log-in to my Yahoo account every time I leave the page. For example: I log in to check my email on Yahoo and then leave my email page. Then when I return to recheck my email I have to log in all over again. I can't stay logged in. If I run my OPERA browser I stay logged in for days without having to sign in all over again.

    Many site issues can be caused by corrupt cookies or cache. In order to try to fix these problems, the first step is to clear both cookies and the cache.
    Note: ''This will temporarily log you out of all sites you're logged in to.''
    To clear cache and cookies do the following:
    #Go to Firefox > History > Clear recent history or (if no Firefox button is shown) go to Tools > Clear recent history.
    #Under "Time range to clear", select "Everything".
    #Now, click the arrow next to Details to toggle the Details list active.
    #From the details list, check ''Cache'' and ''Cookies'' and uncheck everything else.
    #Now click the ''Clear now'' button.
    Further information can be found in the [[Clear your cache, history and other personal information in Firefox]] article.
    Did this fix your problems? Please report back to us!
    "Remove Cookies" from sites causing problems:
    Tools > Options > Privacy > Cookies: "Show Cookies"
    '''Try Firefox Safe Mode''' to see if the problem goes away. Safe Mode is a troubleshooting mode, which disables most add-ons.
    ''(If you're not using it, switch to the Default theme.)''
    * You can open Firefox 4.0+ in Safe Mode by holding the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * Or open the Help menu and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    ''Once you get the pop-up, just select "'Start in Safe Mode"''
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    ''When you figure out what's causing your issues, please let us know. It might help other users who have the same problem.''

  • Best Practice Questions: Method signature for CRUD operations

    Hi,
    I am reading a book about EJB3.0 which has been very helpful to me so far. However I now find myself in a dilemma which is not clearly covered in the book and I would really like to know how best to proceed. In the book it says that an Entity Manager wrapper class (responsible to handle all CRUD operations for a particular object) can have several methods. One of the methods it describes is as follows;
    addUser(String username, String password, String name, String surname, etc){ ... }Note that in the above method the book does not pass the User object as a parameter to the method but rather the attributes of the User object. Therefore my first question is this;
    Is there any benefit / drawback in writing the addUser(...) method in this way? or it is better to write it as follows;
    addUser(User user){ ... }

    AS i know addUser(User user){ ... } is much more useful for several reasons:
    1.Its object oriented
    2.its easy to write , because if Object has many parameters its very painful to write method with comma seperated parameters

  • Problem with crude operations in master detail tables

    Hi,
    I have Master-Detail tables in my page and crud operations are there for both the tables. Create/delete/edit are working fine on the master table but i am facing the following problems for the detail table
    1.delete operation is alway referring to the 1st record.
    2.Edit operation is working fine for the 1st time but when i amt trying to edit any other record it's refer to the previous record, if i did the same again then it's pointing to current record.
    Selected row keys and selectionListner and row selection is defined on my detail table as shown below.
    selectedRowKeys="#{bindings.CmSubscriberTerritoryXrefView1.collectionModel.selectedRow}"
    selectionListener="#{bindings.CmSubscriberTerritoryXrefView1.collectionModel.makeCurrent}"
    rowSelection="single"
    Please do need full.

    Hi,
    Thanks for your quick reply.
    I am using JDeveloper 11g. Yes i select the record, i am using a popup for delete operation so i write a button which invoke popup in that popup i am asking confirmation like do you wanted to delete for not. in the OK button i have return logic like
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding =
    bindings.getOperationBinding("Delete2");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    operationBinding = bindings.getOperationBinding("Commit");
    result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    FacesContext fc = FacesContext.getCurrentInstance();

  • Crud-operations-in-oracle-adf

    hi, I am using 11g 1.2 and ADF BC
    I followed the sample "http://andrejusb.blogspot.com/2010/05/crud-operations-in-oracle-adf-11g-table.html" and built a same thing in my bound task-flow.
    the 'Edit' , 'Insert' , 'Save' and 'Undo' button worked perfectly, but the 'Delete' button is not. let say I have three lines in the table, If I click a row and click the 'Delete' button, then all three lines are disapear, May I know why? Thanks for your guide!
    Rgds!

    But I do have the af:form in the page level. My table is inside the region which is in the page.
    I have added a af:Subform around my af:PanelCollection, but the result is worse, even when I click 'INSERT' button, the all three lines are disapear!!!
    May this sample and code can not work properly inside the region?
    Edited by: xsyang on Jul 19, 2011 4:42 AM
    finally I understand that the solution in the sample is for bindings in the page, but my af:table component in the page fragment. may not directly coding like sample. am i worng? can anybody guide me how to refer to binding in the fragment. Thanks!
    Edited by: xsyang on Jul 19, 2011 8:06 AM

  • Illustrator starts and immediately closes again

    Hello Adobe community,
    I'm having a problem. When I click on my Adobe Illustrator CS6 to start it, it opens and immediately closes again and says "Illustrator was unexpected closed". Did you have similar problems. DO you have a solution for my problem?
    I would be thankful for a reply!

    Nobody can help you without proper system information.
    Working with your Operating System’s Tools
    Mylenium

  • Operator and Unparseable Date "0"

    Has anyone come across this Unparseable Date "0" error when starting up OPERATOR?
    It has just started happening in the last couple of days.
    Operator still works OK but the error is really annoying
    Thanks,
    G
    UPDATE_
    OK - I have operator installed on another workstation which does NOT get the error. On that machine, I have not changed the odiparams.bat file whereas on the workstation where I get the error is configured to point to my sql server master and work repository in the ODI_SECU_DRIVER, ODI_SECU_URL, ODI_SECU_USER, ODI_SECU_ENCODED_PASS, ODI_SECU_WORK_REP,ODI_USER, and ODI_ENCODED_PASS settings....
    Edited by: geeo on Sep 24, 2008 4:06 AM

    Hi-
    It seems to be a bug with ODI operator and concern data values incorrectly populated in filter definition. To fix this issue temporarily, do the below steps:
    1. Open ODI Operator.
    2. Click on the "Filter" button under the menu bar to open a window called "Define Filter".
    3. In this window, clear the 2 "From" and "To" fields.
    4. Close ODI Operator and all other open ODI GUI applications.
    5. Reopen ODI Operator.
    6. Uncheck the "Filter" checkbox in order to disable filtering.
    7. Close ODI Operator and all other open ODI GUI applications.
    8. Reopen ODI Operator.
    Thanks,
    Saravanan Rajavel

  • Cnsuming Lightswitch Odata service in c# winform to perform crud Operations

    HI
    I have created light switch html application which is having  sql as datasource.
    I want to consume the Odataservices that will be created from light switch in c# winforms to perform crud operations .
    Can any one help me how to handled crud operations.
    Thanks and regards
    Venkat

    I found:
    https://social.msdn.microsoft.com/Forums/en-US/71338428-faa6-4e2f-87fb-5ef86f02c69d/how-to-consume-odata-service-made-in-lightswitch-in-a-windows-forms-application?forum=LightSwitchDev11Beta
    https://msdn.microsoft.com/en-us/library/hh973174.aspx
    and a bunch more when I googled "windows forms consuming lightswitch odata"
    These are REST services
    http://blogs.msdn.com/b/bethmassi/archive/2012/03/09/creating-and-consuming-lightswitch-odata-services.aspx
    If you google "windows forms consuming rest services" there are a stack more hits.
    http://www.codeproject.com/Questions/648106/Consuming-REST-WCF-Service-in-Windows-Forms-Applic
    http://www.c-sharpcorner.com/UploadFile/rahul4_saxena/create-and-consume-wcf-restful-service/
    I would recommend you create a "proper" wcf data service rather than using a lightswitch one.
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • Swing CRUD Operations

    Hi All,
    I am working on the crud operations of the swing textfields using javafx. when the user clicks on the Edit button, the fields should be enabled for updating and after edit is finished , the textfields should be updated with the new data. I also have a reset button to reset information in textfields . Could someone help me by providing some examples.
    Regards,
    Sherlyn

    Maybe the [JavaFX CRUD|http://www.learntechnology.net/content/javafx/javafx.jsp] article might interest you.

  • CRUD operations on Data Mart

    Our data sources are as follows:
    - An mdb file (downloaded every hour)
    - Multiple xls files (downloaded every week)
    Our aim is to develop a BI solution using BISM, Data Mart, OLAP cubes etc.
    From my understanding, we do not necessarily require an OLTP DB and we can import our data directly into our data mart using SSIS.
    - However, with a data mart, will we be able to perform CRUD operations on all our data just like an OLTP DB?
    Thanks.

    Hi Darrenod,
    Thank you for your question. 
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated. 
    Thank you for your understanding and support.
    Regards,
    Charlie Liao
    TechNet Community Support

Maybe you are looking for