JPA persist() or merge()

Hi All,
I would like to get clarification between using JPA persist() and merge() where there is a OneToMany EMPLOYEE table unidirectionally joint to ManyToOne TELEPHONE table.
The code snippet for OneToMany Employee.java entity object is as follows:
@Entity
@IdClass(EmployeePK.class)
@Table(name="EMPLOYEE", catalog="CorporationDB", schema="")
public class Employee implements Serializable {  
@OneToMany(cascade={CascadeType.ALL}, fetch=FetchType.EAGER)
    @JoinTable(name="EMPLOYEE_TELEPHONE", catalog="CorporationDB", schema="",
               joinColumns={@JoinColumn(name="FIRSTNAME", referencedColumnName="FIRSTNAME"),
                            @JoinColumn(name="SURNAME", referencedColumnName="SURNAME"),
                            @JoinColumn(name="AGE", referencedColumnName="AGE"),
                            @JoinColumn(name="SEX", referencedColumnName="SEX")},
               inverseJoinColumns={@JoinColumn(name="TELEPHONE_ID")})
        private Collection<Telephone> telephones = new ArrayList<Telephone>();
    public Collection<Telephone> getTelephones()
     return telephones;
    public void setTelephones(Collection<Telephone> telephones)
     this.telephones = telephones;
    }The corresponding detail for ManyToOne Telephone.java entity object is:
@Entity
@Table(name="TELEPHONE", catalog="CorporationDB", schema="")
public class Telephone implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name="ID")
    private int id;
    @Column(name="TELEPHONE")
    private String telephone;
    public void setTelephone(String telephone) {
        this.telephone = telephone;
    public String getTelephone() {
        return telephone;
    }I would like JPA to to ignore (not overwrite) existing record and only add newer unique telephone numbers. persist() does that except it is throwing the following exceptions and continually re-trying to insert the duplicate records:
Local Exception Stack:
*Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.1 (Build b60e-fcs (12/23/2008))): oracle.toplink.essentials.exceptions.DatabaseException*
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry Allan-Smith-20-M' for key 'PRIMARY'
Error Code: 1062
Call: INSERT INTO CorporationDB.EMPLOYEE (FIRSTNAME, SURNAME, AGE, SEX.....) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
*bind => [Allan, Smith, 20, M,....]*
Query: InsertObjectQuery(finance.Employee@1d2d80c)
JTS5054: Unexpected error occurred in after completion
On the other hand, merge() ignores (does not add) duplicate Employee record (good) but it still duplicates the ManyToOne TELEPHONE table. Is it because of the OneToMany(cascade={CascadeType.ALL}} property in Employee.java which duplicates TELEPHONE records automatically? As a result, how to ensure that only unique OneToMany (EMPLOYEE) & ManyToOne (TELEPHONE) records are added once?
persist() seems to work fine except that it is continually erroring out instead of skipping to the next new record.
This Java EE 5 application is running properly.
I am running JDK1.6.0_7, GF2.1 and MySQL on Windows XP.
Thanks in advance,
Jack

I would recommend you continue to use TopLink Essentials as your JPA provider by setting your provider in your persistence.xml, or upgrading to EclipseLink and setting it as your provider. The latest WLS release also includes EclipseLink.
James : http://www.eclipselink.org

Similar Messages

  • Start a JPA persistent cache server but it is hanging

    I create a JPA persistence project and online EJB object HR.EMPLOYEES according to the guide of Chapter 6 of
    Tutorial for Oracle Coherence (3.5). But when I tried to start a JPA persistent cache server, it is hanging and report
    the following message:
    I don't know what is the problem.
    C:\coherence\bin>jpa-cache-server.cmd
    java version "1.6.0_16"
    Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
    Java HotSpot(TM) Server VM (build 14.2-b01, mixed mode)
    2009-11-04 15:11:37.767/0.532 Oracle Coherence 3.5.2/463 <Info> (thread=main, member=n/a):
    Loaded operational configuration from resource "jar:file:/C:/coherence/lib/coherence.jar!/tangosol-
    coherence.xml"
    2009-11-04 15:11:37.767/0.532 Oracle Coherence 3.5.2/463 <Info> (thread=main, member=n/a):
    Loaded operational overrides from resource "jar:file:/C:/coherence/lib/coherence.jar!/tangosol-
    coherence-override-dev.xml"
    2009-11-04 15:11:37.782/0.547 Oracle Coherence 3.5.2/463 <D5> (thread=main, member=n/a):
    Optional configuration override "/tangosol-coherence-override.xml" is not specified
    2009-11-04 15:11:37.782/0.547 Oracle Coherence 3.5.2/463 <D5> (thread=main, member=n/a):
    Optional configuration override "/custom-mbeans.xml" is not specified
    Oracle Coherence Version 3.5.2/463
    Grid Edition: Development mode
    Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
    2009-11-04 15:11:38.157/0.922 Oracle Coherence GE 3.5.2/463 <Info> (thread=main, member=n/a):
    Loaded cache configuration from "file:/C:/home/oracle/coherence/JPA/jpa-cache-config.xml"
    2009-11-04 15:11:38.188/0.953 Oracle Coherence GE 3.5.2/463 <Info> (thread=main, member=n/a):
    Started DefaultCacheServer
    SafeCluster: nullThe contents of jpa-cache-server.cmd file is shown here under:
    setlocal
    :config
    @rem specify the Coherence installation directory
    set coherence_home=C:\coherence
    @rem specify the JVM heap size
    set memory=512m
    :start
    if not exist "%coherence_home%\lib\coherence.jar" goto instructions
    if "%java_home%"=="" (set java_exec=java) else (set java_exec=%java_home%\bin\java)
    :launch
    set java_opts="-Xms%memory% -Xmx%memory% -Dtangosol.coherence.cacheconfig=
    C:\home\oracle\coherence\JPA\jpa-cache-config.xml"
    "%java_exec%" -server -showversion "%java_opts%" -cp "%coherence_home%\lib\coherence.jar;
    C:\home\oracle\coherence\JPA\classes;C:\coherence\lib\coherence-jpa.jar;C:\Oracle\Middleware\
    wlserver_10.3\server\lib\ojdbc6.jar;C:\Oracle\Middleware\modules\javax.persistence_1.0.0.0_1-0-2.jar;
    D:\toplink_11\jlib\eclipselink.jar" com.tangosol.net.DefaultCacheServer %1
    goto exit
    :instructions
    echo Usage:
    echo   ^<coherence_home^>\bin\cache-server.cmd
    goto exit
    :exit
    endlocal
    @echo onEdited by: junez on 04-Nov-2009 12:31

    Now report the following message:
    C:\coherence\bin>jpa-cache-server.cmd
    java version "1.6.0_16"
    Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
    Java HotSpot(TM) Server VM (build 14.2-b01, mixed mode)
    2009-11-04 16:03:54.320/0.563 Oracle Coherence 3.5.2/463 <Info> (thread=main, member=n/a): Loaded operational configurat
    ion from resource "jar:file:/C:/coherence/lib/coherence.jar!/tangosol-coherence.xml"
    2009-11-04 16:03:54.320/0.563 Oracle Coherence 3.5.2/463 <Info> (thread=main, member=n/a): Loaded operational overrides
    from resource "jar:file:/C:/coherence/lib/coherence.jar!/tangosol-coherence-override-dev.xml"
    2009-11-04 16:03:54.335/0.578 Oracle Coherence 3.5.2/463 <D5> (thread=main, member=n/a): Optional configuration override
    "/tangosol-coherence-override.xml" is not specified
    2009-11-04 16:03:54.335/0.578 Oracle Coherence 3.5.2/463 <D5> (thread=main, member=n/a): Optional configuration override
    "/custom-mbeans.xml" is not specified
    Oracle Coherence Version 3.5.2/463
    Grid Edition: Development mode
    Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
    Exception in thread "main" (Wrapped: Failed to load the factory) java.lang.reflect.InvocationTargetException
            at com.tangosol.util.Base.ensureRuntimeException(Base.java:293)
            at com.tangosol.net.DefaultCacheFactoryBuilder.getDefaultFactory(DefaultCacheFactoryBuilder.java:419)
            at com.tangosol.net.DefaultCacheFactoryBuilder.getSingletonFactory(DefaultCacheFactoryBuilder.java:113)
            at com.tangosol.net.DefaultCacheFactoryBuilder.getFactory(DefaultCacheFactoryBuilder.java:173)
            at com.tangosol.net.DefaultCacheFactoryBuilder.getConfigurableCacheFactory(DefaultCacheFactoryBuilder.java:149)
            at com.tangosol.net.CacheFactory.getConfigurableCacheFactory(CacheFactory.java:657)
            at com.tangosol.net.DefaultCacheServer.main(DefaultCacheServer.java:49)
    Caused by: java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
            at com.tangosol.util.ClassHelper.newInstance(ClassHelper.java:662)
            at com.tangosol.net.DefaultCacheFactoryBuilder.getDefaultFactory(DefaultCacheFactoryBuilder.java:381)
            ... 5 more
    Caused by: (Wrapped: Failed to load configuration: C:\home\oracle\coherence\JPA\jpa-cache-config.xml) (Wrapped) java.io.
    IOException: Exception occurred during parsing: looking for id=9, found id=3((0,0,0) Character Data Literal xml version=
    "1.0" encoding="windows-1252" ?>
            at com.tangosol.util.Base.ensureRuntimeException(Base.java:293)
            at com.tangosol.net.DefaultConfigurableCacheFactory.loadConfig(DefaultConfigurableCacheFactory.java:403)
            at com.tangosol.net.DefaultConfigurableCacheFactory.loadConfig(DefaultConfigurableCacheFactory.java:372)
            at com.tangosol.net.DefaultConfigurableCacheFactory.<init>(DefaultConfigurableCacheFactory.java:141)
            ... 11 more
    Caused by: (Wrapped) java.io.IOException: Exception occurred during parsing: looking for id=9, found id=3((0,0,0) Charac
    ter Data Literal xml version="1.0" encoding="windows-1252" ?>
            at com.tangosol.run.xml.XmlHelper.loadXml(XmlHelper.java:137)
            at com.tangosol.run.xml.XmlHelper.loadXml(XmlHelper.java:152)
            at com.tangosol.net.DefaultConfigurableCacheFactory.loadConfig(DefaultConfigurableCacheFactory.java:395)
            ... 13 more
    Caused by: java.io.IOException: Exception occurred during parsing: looking for id=9, found id=3((0,0,0) Character Data L
    iteral xml version="1.0" encoding="windows-1252" ?>
            at com.tangosol.run.xml.SimpleParser.parseXml(SimpleParser.java:134)
            at com.tangosol.run.xml.SimpleParser.parseXml(SimpleParser.java:71)
            at com.tangosol.run.xml.SimpleParser.parseXml(SimpleParser.java:99)
            at com.tangosol.run.xml.XmlHelper.loadXml(XmlHelper.java:133)
            ... 15 more

  • Persist and merge

    Hi!
    I am not clear about difference between persist() and merge() in EntityManager.
    If i use persist(entity) two times in one conversation, then exception occurs.
    But if i use persist(entity) first time, and second time use merge(entity), it does work well.
    So can you explain differences between them?
    Cheers!!!

    persist() is for new objects (inserts) merge() is for existing objects (updates).
    You should only call persist() for new objects the first time you persist them. It will make the new objects managed in the current transaction context to be inserted on commit or flush. You can call persist() on any object that is managed in the current transaction context, but not on detached objects.
    merge() is only required to merge the changes from a detached object (such as serialized objects) into the current transaction context. If you read the object in the current transaction context, you should not call merge on it, it is already managed. After the merge the detached object will still be detached, only the changes in the managed object will be committed.
    -- James : [http://www.eclipselink.org]

  • Adf ejb jpa persistance problem

    Hi everyone,
    I`m a newbie to adf technology.
    I was trying Build a Web Application with JDeveloper 11g Using EJB, JPA, and JavaServer Faces tutorial
    ([http://www.oracle.com/technology/obe/obe11jdev/11/ejb/ejb.html])
    I have a problem when I try to run it.
    It says;
    javax.ejb.EJBException: EJB Exception: ; nested exception is:
    Exception [EclipseLink-4002|http://forums.oracle.com/forums/] (Eclipse Persistence Services - 1.0.1 (Build 20080905)): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00904: "EMAİL": ge&ccedil;ersiz belirleyici (invalid identifier)
    I thing it`s becouse I use a turkish operating system.
    I tried to change the encoding settings to windows1252 intead of windows 1254 but same problem occures.
    It makes the column EMAIL to EMAİL
    Could you please help me abpout this problem?

    Hi,
    can you print out the value that is received in the session facde to see where the conversion happens?
    Frank

  • [solved] JPA - persisting parent & child entities in one hit

    Hi,
    I have an object say, "Bus" and it has a one to many relationship to another object, "Commuter". Suppose i create one Bus instance and one commuter instance and associate them to each other and i want them to save to the database and store the relationship via a foriegn key relationship in the Commuter table, what would the pojo look like? What exact annotations would i require for it to work. Working examples appreciated!

    Thanks for the link, and thats exactly why i want to do this (adf).
    However, the sample does not demonstrate the code for creating a new Department with a Employee at the same time, and wiring up the relational foriegn key.
    Any ideas on how to extend this example to do this? I'd like a form create one entity of each in one action. I followed some advise before to create my own persist() function which persists the Employee object first, then the Department object.
    They both successfully persist but the foriegn key does not get mapped in the table. Any sample code available?

  • Switch propertie from a JPA persistent unit at runtime

    Hi,
    I have a mysql database mapped through JPA (using oracle toplink bundled in Netbeans6.1) an I want to change the "toplink.jdbc.url" propertie of the persistence unit declaration at runtime of my app, is this possible? Getting more into the problem: my app will run in different networks and I cannot leave the propertie "toplink.jdbc.url" static, so in my app I have a swing dialog to change the database server IP and I store it in my own properties file (file_name.properties), so I want my java code to read that properties file and set the correct "toplink.jdbc.url".

    Hello,
    I am using Hibernate and Here are some of the properties in the PersistenceUnit.
    I have used your way of Overriding the properties by passing the Map into createEntityManagerFactory method.
    <property name="hibernate.connection.username" value="root"/>
    <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
    <property name="hibernate.connection.password" value="r3dm0u53"/>
    propertiesMap.put("hibernate.connection.password", "password");
    entityManager = javax.persistence.Persistence.createEntityManagerFactory("persistencePU", propertiesMap).createEntityManager();
    But it is not working the application is still running on the values that it has in the PU file.
    What to do now? any idea?

  • JPA: Persist binary data (byte array)

    Hi,
       when trying to add a field to an entity to hold binary data as a Byte[] (array of objects) NWDS "finds" the following error:
    Class with name '[Ljava.lang.Byte;' not found
    If the field is of type byte[] (array of primitives):
    Class with name '[B' not found
    However, according to the JEE Tutorial (page 686), byte array and Byte array are valid types. Is the JPA implementation lacking this feature or am I missing something? Here the field declaration, including the annotations:
         @Column(name="IMPL_BINARY")
         @Lob
         private byte[] implBinary;
    Thank you for your help in advance.
    Cheers,
    Patrik

    Looks like you're using JDK 6 and Eclipse/WTP has the issue described [here|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6500212]. JDK 6 is not supported as runtime yet anyway, so even if you had been able to build your project, it would not run on the server. Therefore, I'd suggest that you switch to JDK 1.5.
    HTH!
    \-- Vladimir

  • JPA and JSF - Problem persisting object

    Hi all.
    I'm having some trouble with JPA, persisting an object to a MySQL table.
    Let's say I have a simple bean, Message:
    package my.package
    import java.io.Serializable;
    import javax.persistence.Id;
    import javax.persistence.Entity;
    import javax.persistence.Column;
    import javax.persistence.Table;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    @Entity
    @Table(name="messages")
    public class Message implements Serializable {
         @Id
         @GeneratedValue(strategy=GenerationType.AUTO)
         private int id;
         @Column(name="message_text")
         private String message;
         @Column(name="message_author")
         private String author;
         public String getMessage() {
              return this.message;
         public void setMessage(String message) {
              this.message = message;
         public String getAuthor() {
              return this.author;
         public void setAuthor(String author) {
              this.author = author;
    }And a controller for this Message bean:
    package my.package;
    import javax.annotation.Resource;
    import javax.persistence.Query;
    import javax.persistence.EntityManager;
    import javax.persistence.EntityManagerFactory;
    import javax.persistence.PersistenceUnit;
    import javax.transaction.UserTransaction;
    public class MessageController {
         @PersistenceUnit(unitName="em1")
         private EntityManagerFactory emf;
         @Resource
         private UserTransaction utx;
         private Message message;
         public Message getMessage() {
              return this.message;
         public void setMessage(Message message) {
              this.message = message;
         public String save() {
              EntityManager em = null;
              String returnValue = "";
              try {
                   em = this.emf.createEntityManager();
                   utx.begin();
                   em.persist(this.message);
                   utx.commit();
                   returnValue = "success";
              } catch(Exception e) {
                   e.printStackTrace();
                   returnValue = "failure";
              return returnValue;
    }Relevant code from the faces-config.xml:
    <managed-bean>
         <managed-bean-name>MessageController</managed-bean-name>
         <managed-bean-class>my.package.MessageController</managed-bean-class>
         <managed-bean-scope>request</managed-bean-scope>
         <managed-property>
              <property-name>message</property-name>
              <property-class>my.package.Message</property-class>
              <value>#{Message}</value>
         </managed-property>
    </managed-bean>
    <managed-bean>
         <managed-bean-name>Message</managed-bean-name>
         <managed-bean-class>my.package.Message</managed-bean-class>
         <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>This is my simple persistence.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="1.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_1_0.xsd">
        <persistence-unit name ="em1">
             <jta-data-source>jdbc/__glfish</jta-data-source>
        </persistence-unit>
    </persistence>The __glfish resource is all set up via Glassfish to point to my MySQL server, via a MySQLPool.
    Can anyone see what I'm doing wrong? The Message doesn't get added to the table in my database, and I get a NullPointerException in the method MessageController.save() on the property MessageController.message - which I have specified in the faces-config.xml. Shouldn't that be enough? What have I missed?

    Ok, I have (re-)located the problem. It's not my Message property which gets a NullPointerException - it seems like the problem is with my EntityManagerFactory instance. The PersistenceUnit don't get assigned, even though I declare it in my persistence.xml file.
    Maybe it is something wrong with my file structure?
    The .war file have this structure:
    - WEB-INF
         - classes
              - my
                   - package
                        Message.class
                        MessageController.class
         - lib
              [external jars goes here]
              - META-INF
                   persistence.xml
         faces-config.xml
         web.xml
    [*.jsp/*.xhtml goes here]Can anyone see what's wrong?

  • 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 create Insert & Update on master-detail form JPA/EJB 3.0

    Is there any demonstration or tips how to Insert record on master-details form for JPA/EJB 3.0 with ADF binding?

    I have master-detail forms (dept-emp). I drag the dept->operations->create method to JSF page. But when I click create button, only dept form is clear and ready for insert. But emp form is not clear. How can I add create method for this?
    Can you give some example how to pass the right object to the persist or merge method so that it can save both the two objects (master-detail tables)
    Thanks
    Edited by: user560557 on Oct 9, 2009 8:58 AM

  • Toplink comes to a halt in the merge

    Using Toplink JPA. The relevant BM: Stand [1:N] Standversion [1:N] Standassign
    A new Standversion is created by copying another Standversion (usually the previous one) and making changes. This is testcode doing exactly this:
    // find the original
    Standversion lImportFromStandversion = Standversion.findByStandidVersion("A1", 56);
    // determine the highest sequence number
    int lHighestVersion = lImportFromStandversion.getStand().getHighestVersionOfAllMyStandversions();
    if (lHighestVersion == 0) lHighestVersion = 1;
    // create new standversion
    Standversion lNewStandversion = lImportFromStandversion.cloneShallow();
    // initialize the new standversion
    GregorianCalendar lNow = new GregorianCalendar();
    lNewStandversion.setReplaceDate( new GregorianCalendar( lNow.get(GregorianCalendar.YEAR) + 1, lNow.get(GregorianCalendar.MONTH), lNow.get(GregorianCalendar.DATE) ) );
    lNewStandversion.setVersion( lHighestVersion + 1);
    lNewStandversion.setPricePerUnit( lImportFromStandversion.getPricePerUnit());
    lNewStandversion.setDerrivedfromstandversion(lImportFromStandversion);
    // copy the assigns from the original to the new
    int lCnt = 0;
    for (Standassign lImportFromStandassign : new ArrayList<Standassign>( lImportFromStandversion.getStandassignsWhereIAmStandversion() ) ) // The "new ArrayList" forces the whole collection to be read, not lazy loaded. Otherwise this will result in a concurrent modification exception.
    // progress
    lCnt++;
    System.out.println( lCnt + "/" + lImportFromStandversion.getStandassignsWhereIAmStandversion().size());
    // clone
    Standassign lNewStandassign = lImportFromStandassign.cloneShallow();
    // initialize
    lNewStandassign.setChangeIndicator(false);
    lNewStandassign.setStandversion(lNewStandversion);
    // save
    lEntityManager.clear();
    lEntityManager.getTransaction().begin();
    lEntityManager.merge(lNewStandversion);
    lEntityManager.getTransaction().commit();
    There are 60 assigns.
    Stuff is reloaded in the assign and then Toplink is very very in the merge, as in: doesn't return from the call for 5 minutes and then:
    Exception in thread "main" java.util.MissingResourceException: Can't find bundle for base name oracle.toplink.essentials.exceptions.i18n.DescriptorExceptionResource, locale en_US
    at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1508)
    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1262)
    at java.util.ResourceBundle.getBundle(ResourceBundle.java:789)
    at oracle.toplink.essentials.exceptions.i18n.ExceptionMessageGenerator.buildMessage(ExceptionMessageGenerator.java:56)
    at oracle.toplink.essentials.exceptions.DescriptorException.targetInvocationWhileConstructorInstantiation(DescriptorException.java:1559)
    at oracle.toplink.essentials.internal.descriptors.InstantiationPolicy.buildNewInstanceUsingDefaultConstructor(InstantiationPolicy.java:139)
    at oracle.toplink.essentials.internal.descriptors.InstantiationPolicy.buildNewInstance(InstantiationPolicy.java:111)
    at oracle.toplink.essentials.internal.descriptors.ObjectBuilder.buildNewInstance(ObjectBuilder.java:324)
    at oracle.toplink.essentials.descriptors.copying.InstantiationCopyPolicy.buildClone(InstantiationCopyPolicy.java:37)
    at oracle.toplink.essentials.descriptors.copying.AbstractCopyPolicy.buildWorkingCopyClone(AbstractCopyPolicy.java:49)
    at oracle.toplink.essentials.internal.descriptors.ObjectBuilder.instantiateWorkingCopyClone(ObjectBuilder.java:2029)
    at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.cloneAndRegisterObject(UnitOfWorkImpl.java:641)
    at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.registerExistingObject(UnitOfWorkImpl.java:3080)
    at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.registerExistingObject(UnitOfWorkImpl.java:3024)
    at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.registerExistingObject(UnitOfWorkImpl.java:3044)
    at oracle.toplink.essentials.mappings.CollectionMapping.buildElementClone(CollectionMapping.java:201)
    at oracle.toplink.essentials.mappings.CollectionMapping.buildCloneForPartObject(CollectionMapping.java:162)
    at oracle.toplink.essentials.internal.indirection.UnitOfWorkQueryValueHolder.buildCloneFor(UnitOfWorkQueryValueHolder.java:60)
    at oracle.toplink.essentials.internal.indirection.UnitOfWorkValueHolder.instantiateImpl(UnitOfWorkValueHolder.java:161)
    at oracle.toplink.essentials.internal.indirection.UnitOfWorkValueHolder.instantiate(UnitOfWorkValueHolder.java:232)
    at oracle.toplink.essentials.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:90)
    at oracle.toplink.essentials.indirection.IndirectList.buildDelegate(IndirectList.java:193)
    at oracle.toplink.essentials.indirection.IndirectList.getDelegate(IndirectList.java:315)
    at oracle.toplink.essentials.indirection.IndirectList.size(IndirectList.java:640)
    at oracle.toplink.essentials.internal.queryframework.CollectionContainerPolicy.sizeFor(CollectionContainerPolicy.java:184)
    at oracle.toplink.essentials.internal.indirection.TransparentIndirectionPolicy.getRealAttributeValueFromObject(TransparentIndirectionPolicy.java:252)
    at oracle.toplink.essentials.mappings.ForeignReferenceMapping.getRealAttributeValueFromObject(ForeignReferenceMapping.java:370)
    at oracle.toplink.essentials.mappings.CollectionMapping.getRealAttributeValueFromObject(CollectionMapping.java:559)
    at oracle.toplink.essentials.mappings.CollectionMapping.getRealCollectionAttributeValueFromObject(CollectionMapping.java:574)
    at oracle.toplink.essentials.mappings.CollectionMapping.mergeIntoObject(CollectionMapping.java:740)
    at oracle.toplink.essentials.internal.descriptors.ObjectBuilder.mergeIntoObject(ObjectBuilder.java:2114)
    at oracle.toplink.essentials.internal.sessions.MergeManager.mergeChangesOfCloneIntoWorkingCopy(MergeManager.java:427)
    at oracle.toplink.essentials.internal.sessions.MergeManager.mergeChanges(MergeManager.java:249)
    at oracle.toplink.essentials.mappings.ObjectReferenceMapping.mergeIntoObject(ObjectReferenceMapping.java:360)
    at oracle.toplink.essentials.internal.descriptors.ObjectBuilder.mergeIntoObject(ObjectBuilder.java:2114)
    at oracle.toplink.essentials.internal.sessions.MergeManager.mergeChangesOfCloneIntoWorkingCopy(MergeManager.java:427)
    at oracle.toplink.essentials.internal.sessions.MergeManager.mergeChanges(MergeManager.java:249)
    at oracle.toplink.essentials.mappings.CollectionMapping.mergeIntoObject(CollectionMapping.java:768)
    at oracle.toplink.essentials.internal.descriptors.ObjectBuilder.mergeIntoObject(ObjectBuilder.java:2114)
    at oracle.toplink.essentials.internal.sessions.MergeManager.mergeChangesOfCloneIntoWorkingCopy(MergeManager.java:427)
    at oracle.toplink.essentials.internal.sessions.MergeManager.mergeChanges(MergeManager.java:249)
    at oracle.toplink.essentials.mappings.CollectionMapping.mergeIntoObject(CollectionMapping.java:768)
    at oracle.toplink.essentials.internal.descriptors.ObjectBuilder.mergeIntoObject(ObjectBuilder.java:2114)
    at oracle.toplink.essentials.internal.sessions.MergeManager.mergeChangesOfCloneIntoWorkingCopy(MergeManager.java:427)
    at oracle.toplink.essentials.internal.sessions.MergeManager.mergeChanges(MergeManager.java:249)
    at oracle.toplink.essentials.mappings.ObjectReferenceMapping.mergeIntoObject(ObjectReferenceMapping.java:360)
    at oracle.toplink.essentials.internal.descriptors.ObjectBuilder.mergeIntoObject(ObjectBuilder.java:2114)
    at oracle.toplink.essentials.internal.sessions.MergeManager.mergeChangesOfCloneIntoWorkingCopy(MergeManager.java:427)
    at oracle.toplink.essentials.internal.sessions.MergeManager.mergeChanges(MergeManager.java:249)
    at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.mergeCloneWithReferences(UnitOfWorkImpl.java:2709)
    at oracle.toplink.essentials.internal.ejb.cmp3.base.RepeatableWriteUnitOfWork.mergeCloneWithReferences(RepeatableWriteUnitOfWork.java:203)
    at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerImpl.mergeInternal(EntityManagerImpl.java:220)
    at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerImpl.merge(EntityManagerImpl.java:113)
    at nl.reinders.bm.BMTestToplink.main(BMTestToplink.java:263)
    Caused by: java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOfRange(Arrays.java:3209)
    at java.lang.String.<init>(String.java:216)
    at java.lang.StringBuilder.toString(StringBuilder.java:430)
    at java.net.URLStreamHandler.parseURL(URLStreamHandler.java:232)
    at sun.net.www.protocol.file.Handler.parseURL(Handler.java:50)
    at java.net.URL.<init>(URL.java:596)
    at java.net.URL.<init>(URL.java:464)
    at sun.misc.URLClassPath$FileLoader.getResource(URLClassPath.java:972)
    at sun.misc.URLClassPath.getResource(URLClassPath.java:168)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:192)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.util.ResourceBundle$Control.newBundle(ResourceBundle.java:2370)
    at java.util.ResourceBundle.loadBundle(ResourceBundle.java:1400)
    at java.util.ResourceBundle.findBundle(ResourceBundle.java:1365)
    at java.util.ResourceBundle.findBundle(ResourceBundle.java:1294)
    at java.util.ResourceBundle.findBundle(ResourceBundle.java:1294)
    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1236)
    at java.util.ResourceBundle.getBundle(ResourceBundle.java:789)
    at oracle.toplink.essentials.exceptions.i18n.ExceptionMessageGenerator.buildMessage(ExceptionMessageGenerator.java:56)
    at oracle.toplink.essentials.exceptions.DescriptorException.targetInvocationWhileConstructorInstantiation(DescriptorException.java:1559)
    at oracle.toplink.essentials.internal.descriptors.InstantiationPolicy.buildNewInstanceUsingDefaultConstructor(InstantiationPolicy.java:139)
    at oracle.toplink.essentials.internal.descriptors.InstantiationPolicy.buildNewInstance(InstantiationPolicy.java:111)
    at oracle.toplink.essentials.internal.descriptors.ObjectBuilder.buildNewInstance(ObjectBuilder.java:324)
    at oracle.toplink.essentials.descriptors.copying.InstantiationCopyPolicy.buildClone(InstantiationCopyPolicy.java:37)
    at oracle.toplink.essentials.descriptors.copying.AbstractCopyPolicy.buildWorkingCopyClone(AbstractCopyPolicy.java:49)
    at oracle.toplink.essentials.internal.descriptors.ObjectBuilder.instantiateWorkingCopyClone(ObjectBuilder.java:2029)
    at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.cloneAndRegisterObject(UnitOfWorkImpl.java:641)
    at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.registerExistingObject(UnitOfWorkImpl.java:3080)
    cloneShallow:
    nl.reinders.bm.Standversion lNew = new nl.reinders.bm.Standversion();
    lNew.setStand( getStand() );
    lNew.setDerrivedfromstandversion( getDerrivedfromstandversion() );
    lNew.setVersion( getVersion() );
    lNew.setReplaceDate( getReplaceDate() );
    lNew.setPricePerUnit( getPricePerUnit() );
    lNew.setInifill( getInifill() );
    lNew.setComment( getComment() );
    return lNew;
    And:
    nl.reinders.bm.Standassign lNew = new nl.reinders.bm.Standassign();
    lNew.setArticle( getArticle() );
    lNew.setBatchtype( getBatchtype() );
    lNew.setStandversion( getStandversion() );
    lNew.setCode( getCode() );
    lNew.setChangeIndicator( getChangeIndicator() );
    lNew.setEnding( getEnding() );
    lNew.setEnding2( getEnding2() );
    lNew.setAssignean( getAssignean() );
    return lNew;
    This appears to be some kind of recusive thing. The code works fine for a limited number of Standassigns, but when exceeding somewhere around 10 Standassigns, the execution is exceeding 30 seconds. For 60 it's unwaitable.
    What is Toplink doing?

    JPA. And I found the cause but not the reason: all 1:N relations were cascade persist and merge both ways. This causes Toplink to go into what seems like an endless loop (I terminated the testcode after 15 minutes of waiting)..
    For more details see the other thread somewhere half way the first page:
    this is a bug: versioning and deferred constraints
    (I started this thread because this is another topic, but the discussion continued in the other thread never the less.)
    In effect it comes down to that after assigning the PK's Toplink keeps cycling in the same codeset, not accessing the database or anything. By making the cascade go one way, the problem was removed (not solved?).
    However, I still think the endless loop should not happen.

  • How to persist a nullable one-to-one child of an updated parent?

    We have the following case:
    - Parent entity (Employee, table name=Employee) has a child entity (EmployeePosition, table name=EmployeePosition)
    We strongly need the EmployeePosition to be saved in another table for other reasons
    - Child Entity field in Employee:
    @OneToOne(mappedby="employee")
    private EmployeePosition employeePosition ;
    Required Scenario:
    1. Open an existing employee record has employeePosition=null --> We do that normally
    2. Select a position for the employeePosition --> We do that normally
    3. Merge Employee entity, and JPA persists the employeePosition AUTOMATICALLY --> Don't know what to do or which annotations to use
    How to do step 3?
    N.B.
    We tried Cascade.ALL, but, it generates exception (like: primary key column is not found as a parameter for the SQL built by JPA; the SQL is SELECTing from EmployeePosition using Employee Primary Key as parameters and not EmployeePosition primary key), as the parent entity is being merged while the child entity is being persisted; apparently, not supported.
    Thanks in advance

    You should be able to just find() the Employee and set its position and commit.
    If you are finding the Employee in a seperate transaction/EntityManager or serializing it, then you can use merge(), which should work.
    Include your code, SQL log, and exception stack trace.

  • JPA Bug !?

    Hi,
    I'm building a web shop using JPA.
    A couple of my entities are Category(as in category of items) and Item. Here is a minimized code preview :
    @Entity
    @Table(name = "category")
    @NamedQueries(....)
    public class Category implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = true, fetch = FetchType.EAGER)
    @Column(name = "categoryId")
    private Integer categoryId;
    @OneToMany(mappedBy = "categoryId", cascade = CascadeType.REMOVE)
    private List<Item> itemCollection;
    @Entity
    @Table(name = "item")
    @NamedQueries(....)
    public class Item implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = true, fetch = FetchType.EAGER)
    @Column(name = "itemId")
    private Integer itemId;
    @JoinColumn(name = "categoryId", referencedColumnName = "categoryId", updatable=true)
    @ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE})
    private Category categoryId;
    Now my problem is that, after creating a new Item, this method doesn't return it :
    public List<Item> getItemsByCategory(int categoryId) {
    Category category = (Category)entityManager.createNamedQuery("Category.findByCategoryId").setParameter("categoryId", categoryId).getSingleResult();
    List<Item> itemsOfThisCat = category.getItemCollection();
    return itemsOfThisCat;
    Just to make it clear, there is no error, the newly created Item is in db, but it is returned by the above method only if restart the server or redeploy the application !!!!?
    I have this problem both for TopLink and OpenJPA, and I am completing the entire project by my self, from the web design to the db optimization, so I could really use a good and concise advice.
    Cheers,
    Cristi

    I found it natural that JPA will add by itself a newly created Item to the List<Item> of the Category entity.
    I hate it when I get stuck in such small issues, thank u so much for your reply.

  • Remove association refrence using JPA Toplink-essentials

    Hey,
    I have this model:
    @Entity
    public class Employee {
    @OneToMany(Cascade={CascadeType.PERSIST,CascadeType.MERGE})
    private Address address;
    @Entity
    public class Address{
    private String city;
    Default Scenario :
    If i persist an employee object in the db.So the address object will also persist in the db.if i delete the employee object,address object will not deleted since
    Our needs is :
    if i delete the employee object , The address data will be not deleted.
    Any help?

    Not sure I understand, the CascadeType.REMOVE controls if the remove operation is cascaded. Since you have not specified cascade remove a remove will not be cascaded, which seems to be what you want?

  • [JPA] What is the best strategy to revert an entity after rollback?

    Hi,
    Let's assume we have the following scenario:
    I have instantiated an entity, I have populated it with data and I have sent it to an EJB3 to be persisted. In the beginning, the entity's ID is null. So, in the EJB3 we might have something like the following code:
        @PersistenceContext(unitName="someUnit") private EntityManager em;
        @Resource private SessionContext ctx;
    try {
        em.persist(theEntity);       // (L1)
        em.flush();                  // (L2)
        ... >>> call a stored procedure <<< ...
        if (resultOfTheStoredProcedureIndicatesFailure)
            ctx.setRollbackOnly();   // (L3)
    } catch(Throwable t) {
        ctx.setRollbackOnly();       // (L4)
        ... >>> do whatever else is necessary <<< ...
    }Ok, on line (L1) the value for the @Id column gets selected from the sequence and assigned to the appropriate entity field.
    Line (L2) flushes the data to the database, so that the stored procedure will see it.
    Then the stored procedure is called, it fails for some reason and on line (L3) we indicate that we wish to rollback the transaction. And it gets rolled back.
    So far, so good.
    But after the rollback, the entity already has an ID value assigned to its @Id field. And, if optimistic locking is used (that is, @Version), then the version will be assigned too.
    So, is there a recommended way to revert the entity back to its original pristine state? Is it possible that the new "dirty" entity may cause problems along the way, if we retry the operation? I checked both with persist() and merge() on the "dirty" entity and they both seemed to work, albeit with additional DB round-trips.
    Best regards,
    Bisser

    Hello,
    For calendar and contacts, there is this:
    http://supportforums.blackberry.com/t5/BlackBerry-Q10/How-To-OTA-Sync-BB10-and-non-BES-Outlook-Overv...
    With that, I actually keep all of the following in sync:
    Two instances of Desktop Outlook (2007 and 2010)
    Z10
    PlayBook
    Outlook.com
    And, before I decommissioned it, also an Android device. Any device that can synchronize with Outlook.com can use this solution to keep in sync for calendar and contacts. You, of course, need to not use solely local contacts and calendar but instead keep them synchronizing with Outlook.com.
    For the other things you mention, I know of no solutions other than backup/restore...but I do not recall if LINK offers the selective method for those.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

Maybe you are looking for

  • Field Refkey-3 is required for G/L--error while posting

    Hi All Please suggest for the following. When I do posting to Accounting after Payroll, I get one error....'Field RefKey 3 is a required field for G/L account 1000 107020'. I have to inform FI every month & they in return change some settings for thi

  • Best practise documents for Aerospace & Defense (A&D)

    Hi Gurus, I'm unable to find the SAP A&D best practice documents in the list of best practices for industry solutions. Has it been moved to a new industry package? Also, please let me know where I can find some SAP PP A&D documents for reference. Tha

  • How to retrieve PDF file

    Hi     My screen consists of  the fields from date and to date,after entering the dates one PDF should open consisting of data in between the dates.     How can i retrive the PDF,or please tell me the code needed.     I am new in webdynpro,please giv

  • Deleted Recovery partition and want it back...

    i used bootcamp and in windows i used disk management and added a new partition and then i had no mac and windows. hardly i repartitioned my macbook and i deleted recovery partition too. how can i get it back?

  • Greeting Card Error "Valid size not available for this creation"

    I am trying to create a greeting card with photoshop elements 10, but I keep getting this error. How can I create a greeting card?