Input Form using an EJB DataControl

Hi,
I have a question about how to create an input form in a ADF Faces – TopLink app.
First, I created a DataControl over the TopLink mappings, and then I created a JSF page with an Employee form (I’m using the HR database), I dropped a Commit button from the DataControl palette, and this works fine.
But now I’m reading the ADF Developer’s Guide, and this document recommends to create a EJB service and a DataControl over the EJB. I did it, and I recreated the same JSF page with an Employee form. I dropped a mergeEntity method from the DataControl palette, and I defined ${bindings.findAllEmployeeIter.currentRow.dataProvider} as the argument of the method. But if I execute the app, and I make a change on the data, the mergeEntity button doesn´t update the database. What am I missing?
Is there any problem in generating the DataControl directly from the TopLink mappings? Is it preferrable to generate the DataControl from an EJB? Why?
Thanks
Juan Claudio Navarro

Juan,
Try asking this in the toplink forum.
TopLink/JPA
The reason to front your TopLink objects with a session facade is for scalability.
So it will also depend on the number of users your application will have.
The TopLink guys will be able to give you more details.

Similar Messages

  • How to Create an Input Form using a Transient View Object?

    I would like to use a Transient View Object to store data from input forms across a multiple-page enrollment process.
    My question is how to I create the input form using the Transient View Object on the .jspx page? Do I drag/drop an ADF creation form onto the page? Or, use a regular ADF form? Do I need to create the initial row progammatically?
    Just looking for some general directions or set of instructions? I've looked at the SRDemo example (Globals Transient View Object), but I'm not sure how they created the page at design time?
    thanks

    Well following the SRDemo example, this seems to work:
    1. Create Transient View Object
    2. Add to Application Module as a Data control
    3. Add to .jspx page as an ADF Form (not as an ADF Create Form)
    4. Add following code to Application Module containting Transient VO instance:
    protected void prepareSession(Session session) {
    super.prepareSession(session);
    insertTransientViewObjRows();
    private void insertTransientViewObjRows() {
    ViewObject transientvo = getViewObj1();
    transientvo.clearCache();
    transientvo.insertRow(transientvo.createRow());
    }

  • Report error with the input form using the VC BI integration wizard

    Hello All,
    I've created a report using the BI integration wizard in visual composer. I've configured the query with the 'Free Form' query template also I've defined the filters there. This is working fine and giving me the report output. When I deploy this , I could see
    a start point for the data service.
    But instead of the start point with the default values for the filters , I want to have an input form for the users to enter the field values. I added the input form in place of start point. But it's not working even though it doesn't give any error while deploying this report. It gives the following error when I run this report.
    " Data service error occurred,cannot execute OLAP queryCannot get data set: Cannot get data set".
    Could anybody help on this.
    Thanks
    Alok

    Hi Sandeep,
    I'm already draging it from the query input port. Are you referring a different way? How I could have the input variables in the query which I'm creating using the BI integration wizard.  To get this input variable I'm trying to add the input form.
    Am I doing anything wrong here ?
    Pls help.
    Thanks
    Alok

  • ADF input form, changing mode to input rather than display

    aim of what i am tring to do:
    create an input form using ADF and UIX which accepts input and moves to a different page.
    approach taken:
    I have a data control based on a business component created from a database table. I have dragged the columns onto a UIX page as an input form without navigation.
    the problem/question:
    how do i set the data controls mode to create upon displaying the page? I want the page just to accept input and submit. it will never be used for displaying data, which is its current default state.
    i have tried calling the create method of the data control from a few places, but i am not sure where the correct place to call this is.

    You can create a dataaction before the page is called and drag the Create method on to it.
    Or you can add the create method as a button to the page that will end up calling your insert page.
    http://www.oracle.com/technology/obe/obe9051jdev/ADFWorkshop/BuildingADFApplicationsWorkshop.htm

  • BPC 10.1 Unified Model - Is it a must to have BEx query to create an input form/report?

    Dear All,
    Have a cube(Unified) created in BW 7.4.
    To create an input form using that cube(unified), Is it mandatory that I need a BEx query for the input form/report?
    i.e. To create an input form/report in BPC 10.1 Unified environment using a Unified model, is it a MUST to have a BEx query in place? Or, can I create an input form using 10.1 Unified model without BEx query using 10.1 Unified model?
    Thank you!
    Regards,
    Peri

    Hi Peri,
    It doesn't matter what you include in the rows and what in columns or free characteristics: think of it as a sub-cube of the original cube. You are basically listing Dimensions you need in a group of you reports and can add new measures.
    In BPC report you'll arrange them on the screen, format, protect, etc.
    So, some of it is a repeat (not all tho), but for different purposes.
    Hope this helps,
    Gersh

  • Use of oledb database connection in input form of process

    I've created dynamic pdf form with data connection to mssql database and with script that automatically adds rows to table and fills fields.
    When I try to open this form as input form for my process in workspace it generates an error: Unable to create SOM expression. That means that sql database connection works not properly.
    How can I fix this? Is it possible to use data connection to oledb database in the input form?

    Hi,
    I have a form that includes db connection (OLDB ->Access). But in
    workspace I have an error while initiating it. The error is an Adobe Acrobat message;
    "Unable to create SOM expression $record.tablename.fieldname"
    I am using Acrobat 9 pro ext. and when I use reader then there is no problem.
    I removed enhanced security settings in preferences of Acrobat. What else i can do? Any suggestions?
    Thank in advance..

  • Using rich text editor in new asset type input form

    Hey everyone,
    I'm currently trying to create assets based on a newly created asset type (which I of course, created). However, the STORAGE property I declared in the asset definition file is to support formatted text, which would normally be pasted from word documents. Note that I'm using the Basic Asset Model.
    Thus, I need a rich-text editor to be used in the content input form. So, after looking at the tags reference in the developer's documentation, I thought that I could use EWEBEDITPRO to achieve my goal but there's always an error mentionning that the component can't be launched. I supposedly have to configure two parameters, one of them being the path for ewebeditpro.js. I looked for that but haven't found it. On the other hand, I looked at the Oracle WebCenter Sites Property File document and that one stated that EWEBEDITPRO is deprecated and not supported (?!?!).
    So in short, what can I use, as a rich-text/html editor?? Thanks in advance for any reply!
    Edited by: DigitalSelf on May 24, 2012 2:26 PM

    Thanks. From what I've read in the developer's guide, CKEditor was available with assets built from the Flex model. However, I'm currently having a hard time trying to display the content of an attribute with content input through the CKEditor, because it's stored in a blob. Although I've found several examples showing how to read the content of a blob, none of them worked for me...

  • Using elements from input forms to use in reports...can it be done?? XML maybe?

    Hi,
    I am required to create a large number of input forms. For each form item, there is a heading to describe what the form item collects and also additional descriptive text, such as units of measurements etc.
    I intend to create a report that will loop through and display this captured data on a per day basis. As there could be several forms of data multiplied over several days or weeks, this will return a lot of data
    eg.
    Day 1
              Data 1
              Data 2
              Data 3 etc...
    Day 2
              Data 1
              Data 2
              Data 3 etc...
    Day 3
              Data 1
              Data 2
              Data 3 etc...
    etc........
    In addition to the data captured in the database, i also need to furnish the returned data in the report with the headings and descriptive text that was on the forms so that the context of the data is apparent.
    I have thought about how  i may acheive this
    1. check each data item returned and append the appropriate text (could involve hundreds of checks against hundreds of data items....Yikes seems like a bad way to do this
    2. maybe theres another way....reading around i wondered if XML could be used ( i have no experience with XML)
    if the form was constructed with XML, and when the report runs, the returned data is able to be linked to the appropriate XML section and the descriptive text could be appended, rather than be subjected to numerous if...else statements....is this feasible with XML? how could i achieve this?
    Sorry if this is unclear or not what XML is about and i'm way off...I'm learning this stuff as i go along so only have the internet and forums to bounce ideas off.
    Thanks for reading this and if you've got any ideas about how i might achieve this with XML or not...i'm very open to suggestions
    Cheers

    Database is MySQL
    SnakEyez02 wrote:
    Ok, let's take this one step at a time.  First what database type is this going into?  Pointing you in the right direction for that is the best place to start.
    >> MySQL
    Next when you talk about returning the data to a report, are you using a reporting service or what are you trying to do here?
    >> HTML/PHP report created with Dreamweaver with queries to recordset
    Depending on what needs to be done, the type of database and the complexity of the data, I have found that simply entering the data into the database and running a query out of a Sharepoint server or even Excel will usually suffice unless there is something in play that we don't know about.
    >>  Yes i can query the database and use those results, what i also want to use is the extraneous elements, such as headings, descriptive text e.g for an input field that captures temperature, you would have
    Heading              Input element                     Descriptive text
    Temperature:      [ Input temp in box here]     degree centigrade
    I want to know if there is a way of reusing these from my forms into my report by using XML, rather that some onerous checking process to append the text to returned data.
    Thanks for taking the time to consider this..

  • Multiple reports in same sheet used as input form

    Hi,
    I am using the Excel EPM Add-In and I would like to use different reports in the same sheet, going with the same connection to the same Planning Book and Data View in APO DP. I would like to use them all as an input form (I already checked 'Use as Input Form in the sheet options). When I try to upload adapted data from the first report, this works well, but when I try this from the second report, I get the error 'There is no data to save'.
    Can anyone help me on this issue?
    Kind regards,
    Kristof

    Hello Hassan,
    I'm not sure if I completely understand your question, but I suppose you always have to do the following steps:
    - Log on to the system (your usual SAP user and pw)
    - Create a report:
    - Choose the characteristics you want to see and always take the Key Figures (Row Axis) and Time (Column Axis) into the report (in the example, I only took the Product characteristic)
    - Click on the dimensions you have chosen and select what you want to see in your report (I often take 'All members')
    - Press 'OK', normally you should now see the data you chose.
    Kind regards,
    Kristof

  • Use data input form in workflow

    Greetings,
    I need to input some fixed asset information from FI-AA master data in a data input form and route through a workflow process before finally update the asset master data. Does anyone does something similar before? Is it technically possible? Is there any guide available here.
    Thanks
    Steve

    Hi,
    you can put several table controls / alv grids on one dynpro.
    find example in :
    SE38 - environment - reuse library
    Andreas

  • Create Input Form

    I started to build a Fusion App with EJB-JPA business layer.
    I am working to create an Input Form but I can't follow exactly the paragraph 26.6 of Fusion Dev. Guide (create an Input Form) because I can't have a createInsert operation on my DataControl.
    How can I create an Input Form into application whit DacaCOntrol created from EJB-JPA business components ?

    I am very frustrating , it is ever more clear for me that it's impossible to build a nice Fusion App without to use the SDF BC .
    In this case I have a entity , Account .
    Simply I want to create a form to insert all fields of Account.
    Then I dragged the accountFindAll collection from data control and dropped it as ADF Form.
    After, I have created 1 methodAction to call the persistAccount (Account) method and one action to initially have an Account object as current row of accountFindAll iterator.
    Seem all ok , or not ?
    Instead I have a lot of problem :
    1) when using the page to insert Account and after return to other page listing all Account , I see 2 Account created with the same data, one is Account really inserted in DB and another is Account stored in current row of accountFindAll iterator
    2) when I reuse the insert page in the second time the account form is populated with data previously inserted
    please help me ... I want to make a form to create a Simple object but I have a EJB-JPA business layer ,not ADF BC , it's possible ???
    This is my page def :
    <?xml version="1.0" encoding="UTF-8" ?>
    <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel" version="11.1.2.60.17" id="createAccountPageDef"
    Package="admin">
    <parameters/>
    <executables>
    <variableIterator id="variables"/>
    <page path="templates.mainTemplatePageDef" id="ptb1" Refresh="ifNeeded"/>
    <iterator Binds="root" RangeSize="-1" DataControl="AdminServiceLocal" id="AdminServiceLocalIterator"/>
    <accessorIterator MasterBinding="AdminServiceLocalIterator" Binds="accountFindAll" RangeSize="-1"
    DataControl="AdminServiceLocal" BeanClass="org.savino.hb.model.entity.Account"
    id="accountFindAllIterator" Refresh="never"/>
    <invokeAction id="ia1" Binds="Create" Refresh="prepareModel"/>
    <accessorIterator id="userFindAllIterator" MasterBinding="AdminServiceLocalIterator" Binds="userFindAll"
    RangeSize="25" DataControl="AdminServiceLocal" BeanClass="org.savino.hb.model.entity.User"
    Refresh="prepareModel"/>
    <!--
    <accessorIterator MasterBinding="accountFindAllIterator" Binds="userList" RangeSize="25"
    DataControl="AdminServiceLocal" BeanClass="org.savino.hb.model.entity.User"
    id="userListIterator"/>
    -->
    </executables>
    <bindings>
    <attributeValues IterBinding="accountFindAllIterator" id="dataSaldo">
    <AttrNames>
    <Item Value="dataSaldo"/>
    </AttrNames>
    </attributeValues>
    <attributeValues IterBinding="accountFindAllIterator" id="descr">
    <AttrNames>
    <Item Value="descr"/>
    </AttrNames>
    </attributeValues>
    <attributeValues IterBinding="accountFindAllIterator" id="iban">
    <AttrNames>
    <Item Value="iban"/>
    </AttrNames>
    </attributeValues>
    <attributeValues IterBinding="accountFindAllIterator" id="saldo">
    <AttrNames>
    <Item Value="saldo"/>
    </AttrNames>
    </attributeValues>
    <action IterBinding="accountFindAllIterator" id="Create" RequiresUpdateModel="true" Action="createRow"/>
    <methodAction id="persistAccount" RequiresUpdateModel="true" Action="invokeMethod" MethodName="persistAccount"
    IsViewObjectMethod="false" DataControl="AdminServiceLocal"
    InstanceName="data.AdminServiceLocal.dataProvider"
    ReturnName="data.AdminServiceLocal.methodResults.persistAccount_AdminServiceLocal_dataProvider_persistAccount_result">
    <NamedData NDName="account" NDValue=""
    NDType="org.savino.hb.model.entity.Account"/>
    </methodAction>
    </bindings>
    </pageDefinition>
    Edited by: Kronos72it on Oct 6, 2011 6:14 PM
    any reply ?

  • I m not getting connected to oracle 9i database using my ejb...

    hi i have made a simple ejb which simply connects to a database of oracle 9i using a datasource on oracle 10g application server...but now my problem is that when i am trying to deploy the ejb ..it is not getting deployed...it shows the following error..
    Deployment failed:nested exception
    resolution:
    base exception:
    com.evermind.server.rmi.OrionRemoteException
    Disconnected:Connection reset. Disconnected:Connection reset.
    the code i am using for EJB class is as follows
    package Simpapp;
    import javax.ejb.*;
    import java.sql.*;
    import javax.naming.*;
    import javax.sql.DataSource;
    public class SimpappBean implements SessionBean {
        static final String DATASOURCE = "bajaj";
        static final String SQL = "select * from login ";
        DataSource ds;
        public String upper (String input) throws java.rmi.RemoteException {
         try {
             Connection conn = ds.getConnection ("bajaj10g","bajaj10g");
             Statement sql = conn.createStatement ();
             //sql.setString (1, input);
             ResultSet results = sql.executeQuery (SQL);
             if (results.next () == false) {
              System.out.println ("No rows for "+ input);
                  throw new java.rmi.RemoteException ("SQL failure");
             } // if
             String result = results.getString ("username");
             results.close ();
             sql.close ();
             conn.close ();
             if (result == null) {
              System.out.println ("NULL result for "+ input);
                  throw new java.rmi.RemoteException ("SQL failure");
             } else
              return (result);
         } catch (SQLException sqle) {
             System.err.println ("While executing SQL: " +
              sqle.getMessage ());
             throw new java.rmi.RemoteException ("SQL failure");
            } catch (Exception e) {
             System.err.println ("Unknown Exception: " +
              e.getMessage ());
             throw new java.rmi.RemoteException ("Bean Exception: " +
              e.getMessage ());
         } // catch
        } // simpapp
        public void ejbCreate () {
             try {
             Context ctx = new InitialContext ();
             ds = (DataSource) ctx.lookup (DATASOURCE);
         } catch (Exception e) {
             System.out.println ("While creating Bean " +
              e.getMessage ());
         } // catch
        } // ejbCreate
        public void ejbRemove () {}
        public void ejbActivate () {}
        public void ejbPassivate () {}
        public void setSessionContext (SessionContext ctx) {}
    } // SimpappBeancan any body suggest me where lies the problem???
    all my Home ,Remote classes are doing well when they are used for any other simple helloworld type of program

    Is that the only Oracle client installed? If you have another one hanging around it could be using the wrong tnsnames file.

  • How do you construct a web form using coldfusion??

    How do you construct a web form using coldfusion?? any
    examples?
    thanks in adv.

    A sample Form:
    <cfform action="CCARProc.cfm"
    enctype="multipart/form-data" method="post" name="CCAR"
    onsubmit="return verify()">
    <table width="730" border="0" cellpadding="2"
    cellspacing="1" align="center" class="unnamed1">
    <!--DWLayoutTable-->
    <tr valign="top">
    <td colspan="3" bgcolor="#F2F2F2">Name Of
    Requester(<font color="red">*</font>)</td>
    <td width="402" bgcolor="#F2F2F2"><cfinput
    type="text" name="Requestor_Name" size="15" value="#REQNAME#"
    maxlength="25" >
     MTABT Email(<font
    color="red">*</font>) 
    <cfinput name="Req_Email" type="text" size="8"
    maxlength="20" value="#ReqEmail#"
    >@mtabt.org</td></tr>
    <tr>
    <td colspan="3">Requester Telephone #(<font
    color="red">*</font>) </td>
    <td><cfinput type="text" VALUE="#REQPHONE#"
    name="RPhone" size="12" maxlength="12" message="Requester Phone
    cannot be blank / Invalid Entry!" required="yes"
    validate="telephone"> [e.g. xxx xxx xxxx or
    xxx-xxx-xxxx]</td>
    </tr>
    <tr>
    <td colspan="3" bgcolor="#F2F2F2">Facility(<font
    color="red">*</font>)</td>
    <td bgcolor="#F2F2F2">
    <cfselect name="Facil">
    <option value="2B">2B </option>
    <option value="BBT">BBT </option>
    <option value="BW">BW </option>
    <option value="CB">CB </option>
    <option value="HH">HH </option>
    <option value="MP">MP </option>
    <option value="QMT">QMT </option>
    <option value="RI">RI </option>
    <option value="TM">TM </option>
    <option value="TB">TB </option>
    <option value="TN">TN </option>
    <option value="VN">VN </option>
    </cfselect>
    </td>
    </tr>
    <tr>
    <td colspan="3">Department(<font
    color="red">*</font>)</td>
    <td><cfselect name="Dept">
    <option value="Contracts">Contracts </option>
    <option value="Engineering">Engineering
    </option>
    <option value="Executive Office">Executive
    Office</option>
    <option value="Finance">Finance </option>
    <option value="General Counsel">General Counsel
    </option>
    <option value="HS">HS </option>
    <option value="HR">HR </option>
    <option value="ISD">ISD</option>
    <option value="Legal">Legal </option>
    <option value="Labor Relations">Labor Relations
    </option>
    <option value="Operations">Operations </option>
    <option value="Payroll">Payroll </option>
    <option value="Planning & Budget">Planning &
    Budget </option>
    <option value="Procurement & Mtrl">Procurement
    & Mtrl </option>
    <option value="Purchasing">Purchasing </option>
    <option value="Revenue Management">Revenue Management
    </option>
    <option value="Staff Services">Staff Services
    </option>
    <option value="SD">SD</option>
    <option value="Technology">Technology</option>
    </cfselect></td>
    </tr>
    <tr>
    <td colspan="3" bgcolor="#F2F2F2">Division(<font
    color="red">*</font>)</td>
    <td bgcolor="#F2F2F2"><cfinput name="Div"
    type="text" size="20" maxlength="25" VALUE=""></td>
    </tr>
    <tr valign="top">
    <td height="27" colspan="3" >Justification(<font
    color="red">*</font>)</td>
    <td bgcolor=""><textarea name="Justi" cols="50"
    rows="3" wrap="VIRTUAL" ></textarea> </td>
    </tr>
    <tr>
    <td colspan="3" bgcolor="#F2F2F2">VP Approval
    By (<font color="red">*</font>)</td>
    <td bgcolor="#F2F2F2"><cfinput name="VPAppFName"
    type="text" size="20" maxlength="25" VALUE="#VPFName#">
         MTABT
    Email(<font color="red">*</font>) 
    <cfinput name="VPE" type="text" size="8" maxlength="20"
    value="#VPEmail#" >@mtabt.org</td>
    </tr>
    <tr>
    <td colspan="3" valign="top"
    bgcolor="#F2F2F2"></td>
    <td colspan="2" rowspan="2" valign="top"
    bgcolor="#F2F2F2"><div align="left">
    <input name="Submit" type="submit" value="SubmitTheForm"
    class="button"
    style="font-size='10pt';color='#663399';font-face='Arial,
    Helvetica, sans-serif';" >
    <input name="Reset" type="reset" value="ReSetTheForm"
    class="button"
    style="font-size='10pt';color='#663399';font-face='Arial,
    Helvetica, sans-serif';">
    </div></td>
    <td width="90" valign="top"
    bgcolor="#F2F2F2"></td>
    </tr>
    </table>
    <div align="right"><span class="style4">Revised(
    01.28.05 )</span>
    <input name="submitDate" type="hidden"
    value="<cfoutput>#DateFormat(Now(),'mm/dd/yy')#</cfoutput>">
    </div>
    </cfform>

  • How to create a cache for JPA Entities using an EJB

    Hello everybody! I have recently got started with JPA 2.0 (I use eclipseLink) and EJB 3.1 and have a problem to figure out how to best implement a cache for my JPA Entities using an EJB.
    In the following I try to describe my problem.. I know it is a bit verbose, but hope somebody will help me.. (I highlighted in bold the core of my problem, in case you want to first decide if you can/want help and in the case spend another couple of minutes to understand the domain)
    I have the following JPA Entities:
    @Entity Genre{
    private String name;
    @OneToMany(mappedBy = "genre", cascade={CascadeType.MERGE, CascadeType.PERSIST})
    private Collection<Novel> novels;
    @Entity
    class Novel{
    @ManyToOne(cascade={CascadeType.MERGE, CascadeType.PERSIST})
    private Genre genre;
    private String titleUnique;
    @OneToMany(mappedBy="novel", cascade={CascadeType.MERGE, CascadeType.PERSIST})
    private Collection<NovelEdition> editions;
    @Entity
    class NovelEdition{
    private String publisherNameUnique;
    private String year;
    @ManyToOne(optional=false, cascade={CascadeType.PERSIST, CascadeType.MERGE})
    private Novel novel;
    @ManyToOne(optional=false, cascade={CascadeType.MERGE, CascadeType.PERSIST})
    private Catalog appearsInCatalog;
    @Entity
    class Catalog{
    private String name;
    @OneToMany(mappedBy = "appearsInCatalog", cascade = {CascadeType.MERGE, CascadeType.PERSIST})
    private Collection<NovelEdition> novelsInCatalog;
    The idea is to have several Novels, belonging each to a specific Genre, for which can exist more than an edition (different publisher, year, etc). For semplicity a NovelEdition can belong to just one Catalog, being such a Catalog represented by such a text file:
    FILE 1:
    Catalog: Name Of Catalog 1
    "Title of Novel 1", "Genre1 name","Publisher1 Name", 2009
    "Title of Novel 2", "Genre1 name","Pulisher2 Name", 2010
    FILE 2:
    Catalog: Name Of Catalog 2
    "Title of Novel 1", "Genre1 name","Publisher2 Name", 2011
    "Title of Novel 2", "Genre1 name","Pulisher1 Name", 2011
    Each entity has associated a Stateless EJB that acts as a DAO, using a Transaction Scoped EntityManager. For example:
    @Stateless
    public class NovelDAO extends AbstractDAO<Novel> {
    @PersistenceContext(unitName = "XXX")
    private EntityManager em;
    protected EntityManager getEntityManager() {
    return em;
    public NovelDAO() {
    super(Novel.class);
    //NovelDAO Specific methods
    I am interested at when the catalog files are parsed and the corresponding entities are built (I usually read a whole batch of Catalogs at a time).
    Being the parsing a String-driven procedure, I don't want to repeat actions like novelDAO.getByName("Title of Novel 1") so I would like to use a centralized cache for mappings of type String-Identifier->Entity object.
    Currently I use +3 Objects+:
    1) The file parser, which does something like:
    final CatalogBuilder catalogBuilder = //JNDI Lookup
    //for each file:
    String catalogName = parseCatalogName(file);
    catalogBuilder.setCatalogName(catalogName);
    //For each novel edition
    String title= parseNovelTitle();
    String genre= parseGenre();
    catalogBuilder.addNovelEdition(title, genre, publisher, year);
    //End foreach
    catalogBuilder.build();
    2) The CatalogBuilder is a Stateful EJB which uses the Cache and gets re-initialized every time a new Catalog file is parsed and gets "removed" after a catalog is persisted.
    @Stateful
    public class CatalogBuilder {
    @PersistenceContext(unitName = "XXX", type = PersistenceContextType.EXTENDED)
    private EntityManager em;
    @EJB
    private Cache cache;
    private Catalog catalog;
    @PostConstruct
    public void initialize() {
    catalog = new Catalog();
    catalog.setNovelsInCatalog(new ArrayList<NovelEdition>());
    public void addNovelEdition(String title, String genreStr, String publisher, String year){
    Genre genre = cache.findGenreCreateIfAbsent(genreStr);//##
    Novel novel = cache.findNovelCreateIfAbsent(title, genre);//##
    NovelEdition novEd = new NovelEdition();
    novEd.setNovel(novel);
    //novEd.set publisher year catalog
    catalog.getNovelsInCatalog().add();
    public void setCatalogName(String name) {
    catalog.setName(name);
    @Remove
    public void build(){
    em.merge(catalog);
    3) Finally, the problematic bean: Cache. For CatalogBuilder I used an EXTENDED persistence context (which I need as the Parser executes several succesive transactions) together with a Stateful EJB; but in this case I am not really sure what I need. In fact, the cache:
    Should stay in memory until the parser is finished with its job, but not longer (should not be a singleton) as the parsing is just a very particular activity which happens rarely.
    Should keep all of the entities in context, and should return managed entities form mehtods marked with ##, otherwise the attempt to persist the catalog should fail (duplicated INSERTs)..
    Should use the same persistence context as the CatalogBuilder.
    What I have now is :
    @Stateful
    public class Cache {
    @PersistenceContext(unitName = "XXX", type = PersistenceContextType.EXTENDED)
    private EntityManager em;
    @EJB
    private sessionbean.GenreDAO genreDAO;
    //DAOs for other cached entities
    Map<String, Genre> genreName2Object=new TreeMap<String, Genre>();
    @PostConstruct
    public void initialize(){
    for (Genre g: genreDAO.findAll()) {
    genreName2Object.put(g.getName(), em.merge(g));
    public Genre findGenreCreateIfAbsent(String genreName){
    if (genreName2Object.containsKey(genreName){
    return genreName2Object.get(genreName);
    Genre g = new Genre();
    g.setName();
    g.setNovels(new ArrayList<Novel>());
    genreDAO.persist(t);
    genreName2Object.put(t.getIdentifier(), em.merge(t));
    return t;
    But honestly I couldn't find a solution which satisfies these 3 points at the same time. For example, using another stateful bean with an extended persistence context (PC) would work for the 1st parsed file, but I have no idea what should happen from the 2nd file on.. Indeed, for the 1st file the PC will be created and propagated from CatalogBuilder to Cache, which will then use the same PC. But after build() returns, the PC of CatalogBuilder should (I guess) be removed and re-created during the succesive parsing, although the PC of Cache should stay "alive": shouldn't in this case an exception being thrown? Another problem is what to do when the Cache bean is passivated. Currently I get the exception:
    "passivateEJB(), Exception caught ->
    java.io.IOException: java.io.IOException
    at com.sun.ejb.base.io.IOUtils.serializeObject(IOUtils.java:101)
    at com.sun.ejb.containers.util.cache.LruSessionCache.saveStateToStore(LruSessionCache.java:501)"
    Hence, I have no Idea how to implement my cache.. Can you please tell me how would you solve the problem?
    Many thanks!
    Bye

    Hi Chris,
    thanks for your reply!
    I've tried to add the following into persistence.xml (although I've read that eclipseLink uses L2 cache by default..):
    <shared-cache-mode>ALL</shared-cache-mode>
    Then I replaced the Cache bean with a stateless bean which has methods like
    Genre findGenreCreateIfAbsent(String genreName){
    Genre genre = genreDAO.findByName(genreName);
    if (genre!=null){
    return genre;
    genre = //Build new genre object
    genreDAO.persist(genre);
    return genre;
    As far as I undestood, the shared cache should automatically store the genre and avoid querying the DB multiple times for the same genre, but unfortunately this is not the case: if I use a FINE logging level, I see really a lot of SELECT queries, which I didn't see with my "home made" Cache...
    I am really confused.. :(
    Thanks again for helping + bye

  • How to combine data from different input forms outside a nested iView

    Hi,
    i try to combine data from different input forms in a single one.
    Because of space reasons in Flex compiling i already use nested iViews. Within these nested iViews its possible to use the 'combine' function to do this.
    But in the main iView I cant compose these function with other elements. I need to do this because of using these model in Guided Procedures with output parameters. These parameters I only get with a 'endPoint'. Unfortunatly its not possible to combine data from different input forms into the 'endPoint'.
    Is there any solution?
    Thanx
    Mathias

    Hi Scott,
    i tried this already and i also tried to map all parameters in the endpoint by drawing lines from the other forms and assign the 'empty parameters' by a formula.
    And when i create a collable object in GP and assign the VC iView, only the parameters of the parent-form (the form who trigger the event) are shown as output-parameters.
    Maybe any other ideas? I cant believe that such a simple thing is not possible?!?!
    In my opinion, thats a bug, that I'am not able to use the combine-operator in the main VC-iView. Whats your mind?
    greets
    mathias

Maybe you are looking for

  • Text input as variable in a URL

    I want to create a simple flash document with a text input field, and a button that will go to a URL. The trick is that the text input field needs to replace an element in the URL for personlaization purposes. I got the field, and I got the button. W

  • 2 iPods, 2 PCs, one iTunes account

    ..and 2 people with different tastes. Just got the 2nd iPod, and don't want to mess this up. What would be the best way to pay with one account, and continue to dedicate one iPod per PC?

  • MAIL AND ICAL PROBLEM

    Hi ,  I have a BBZ10 , and I have  a problem in sending e.mail and with the syncronization of the calendar with iCal of my MAC.  My smtp is configurated with the details of my domain , and the configuration is ok.  ICal is also configurated by follow

  • Commit work in RFC function module

    hi all. What will happend if i give commit in the RFC function module . why we need to use BAPI_Commit after updating through BAPI function module. regards, Madhavi

  • IPhoto11 will not assign keywords

    I have just opened iPhoto 11 on my new iMac27 with Lion.  I tried assigning keywords following the instructons carefully, but they never appear below the photos.  I used to do this easily with earlier versions of iPhoto.  Previously-assigned keywords