Hibernate child object creation problem

hi,
i have two java classes named "user" and "writer"
writer is subclass of user.
with hibernate mapping files , i 'm mapping objects with table-per-subclass strategy...
here is my mapping code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="User" table="User">
<id name="id" type="long" column="id">
<generator class="increment"/>
</id>
<property name="userName" column="userName"/>
<joined-subclass name="Writer" table="Writer">
<key column="user_id"/>
<set name="articles" table="writer_articles" lazy="false">
<key column="user_id"/>
<many-to-many column="Article_id"
unique="true"
class="Article"/>
</set>
</joined-subclass>
</class>
</hibernate-mapping>
when i create a writer(child) object, writer record is inserted to two tables with the same id column.it's good.not a problem
but when i create a user(parent) object then if i want to change role of user to writer it's a problem...
for example:
User user=new User(..); user is inserted to user table with id =10
i want to save same user as a writer with same id number to writer table
Writer writer =new Writer(..); writer must be inserted to writer table with id=10_
in hibernate writer is inserted to writer table with different id number...
what must i do to solve problem ??

nobody replied about my problem...
i searched on google and learned some information
i think ,there is two way to resolve this issue:
1) -delete parent record - and -create child record-
but this could not be efficient.
2) insert child record with same id number to child table manually (by HQL )
Regards.

Similar Messages

  • ARRAY object creation problem in Java

    Hi I am encountring when trying to create ARRAY in one case
    while the same code works perfectly in other case.
    The following code works fine:
    Connection con=getConnection();
    String[][] elements = new String[1][2];
    elements[0][0] =new Long(1111).toString();
    elements[0][1] =new Long(2222).toString();
    ArrayDescriptor desc = ArrayDescriptor.createDescriptor("TYPE1",con);
    toReturn = new ARRAY(desc,con,elements);
    The following CODE GIVES ERROR :
    Connection con=getConnection();
    String[] elements = new String[1];
    elements[0] =new Long(1111).toString();
    ArrayDescriptor desc = ArrayDescriptor.createDescriptor("TYPE2",con);
    toReturn = new ARRAY(desc,con,elements);
    Please help.
    FYI :
    type TYPE1 is table of OBJECT : (ID NUMBER, Name VARCHAR2(50));
    type TYPE2 is table of OBJECT : (ID NUMBER);
    I tried to pass array of long ,int etc in case of TYPE2 but with no advantage.

    Hi Lawrence,
    I have checked the system in the correct path only. I am checking in the following path
      System Admnistration -->System Landscape-->then Portal content (on the left hand side)
    What do you mean by consistancy problem ??? Mean while i will check with basis guys Apart from consulting them , As a Ep consultant do i need to check anything???
    please correct me if i am wrong.....

  • ADOCE Object creation problem

    Hi,
    Using Oracle lite release 5.0.2 I did packaged the Transport tutorial and successfully deployed it to a Pocket PC. For this I followed the instructions listed in the Oracle Lite 9i Developers Guide for Windows CE. (All the s/w and h/w requirements are fulfilled.)
    On executing the Transport application on the Pocket PC the application is throwing an error, "Error creating ActiveX component". This error is occuring on a statement which creates the Connection object using the OLADOCE dll. The OLADOCE.dll file is present in the Windows folder. To ensure the availability of the dll file I copied the file in the same folder where the Transport file is located on the Pocket PC. But the problem persisted.
    Can any one guide me so to resolve this issue?
    Thanks in Advance,
    Sachin.

    Sachin,
    Please try to re-register OLADOCE.dll using ceregsvr.exe. If this does not work, please reinstall the client and try the tutorial again.
    - Junius

  • Problem accessing child object and changing its appearance (color)

    For a program, I need to be able to access a child object (in this case a box) after adding it to a transform group and change its appearance, for example the color of its top face. I have included a small code example to show my problem. The box is the only child I have added to the TransformGroup, but when I call getChild(), it returns a node, and thus I can't then call getShape() to get the top face and change its appearance. What am I doing wrong?
    public BranchGroup createSceneGraph() {
         BranchGroup objRoot = new BranchGroup();
         Transform3D rotate = new Transform3D();
         Transform3D tempRotate = new Transform3D();
    rotate.rotX(Math.PI/4.0d);
         tempRotate.rotY(Math.PI/4.0d);
    rotate.mul(tempRotate);
         TransformGroup objRotate = new TransformGroup(rotate);
         objRoot.addChild(objRotate);
         Appearance ap = new Appearance();
         Appearance app = new Appearance();
         Appearance apr = new Appearance();
         ColoringAttributes colr = new ColoringAttributes();
         ColoringAttributes colg = new ColoringAttributes();
         colr.setColor((float)1, (float)0, (float)0);
         ap.setColoringAttributes(colr);
    colg.setColor((float)0,(float)1, 0);
         apr.setColoringAttributes(colg);
         Box box = new Box((float)0.4, (float)0.4, (float)0.4, app);
         box.getShape(4).setAppearance(ap);
         objRotate.addChild(box);
         objRotate.getChild(0).getShape(4).setAppearance(ap);
    objRoot.compile();
         return objRoot;
    }

    It would help if you gave us the following System information:
    Operating System/version
    Photoshop version number
    Amount of RAM installed
    Hard drive(s) capacity
    Make and model number of video card
    Also try resetting your preferences as described in the FAQ.
    http://forums.adobe.com/thread/375776?tstart=0
    You either have to physically delete (or rename) the preference files or, if using the Alt, Ctrl, and Shift method, be sure that you get a confirmation dialog.
    This resets all settings in Photoshop to factory defaults.
    A complete uninstall/re-install will not affect the preferences and a corrupt file there may be causing the problem.

  • Problem creating non-persistent Child Objects

    I have the need to create a non persistable child object in the
    jdoPreStore of a parent object. I then perform some tests on the parent
    to determine if the child object needs to be persisted or not. If I leave
    the child non persistent it still writes to the database.
    I was performing the follwoing piece of code
    Class Parent {
    // The relationship is a 0 to many
    public Child createChild() {
    Child child = .....//create non persistent object
    child.setParent(this);
    getChild().add(child);
    It appears that if I remove the getChild().add(child). It does not
    persist (as desired).
    Is this correct behaviour?? I dont think that it should be, but if it is
    then I have a further problem.
    If that child object inherits from another object and you remove the
    getChild().add(child) kodo outputs an invalid object to the database. It
    doesnt insert a row to the child table. But it inserts a row to the
    childs inherited object table. This is now an invalid object and will
    fail upon loading.
    Any help on this would be appreciated.
    Thanks
    Luke.

    JDO has something called persistence by reachability. This means that
    objects do not have to explicitly be marked as to be persistent as JDO
    will traverse the object graph to ensure that all nodes are persistent.
    I think you are seeing this behavior combined with another side
    behavior: Kodo requires that both sides of a relation be set.
    Basically, keep your objects in synch (set both sides of the relation).
    And if you want to hold onto a reference to non-persistent object
    before you decide what to do with it, add a transient field or a field
    marked "persistence-modifier="none"" in your metadata and then process
    those transient fields in jdoPreStore ().
    i.e.
    if (//businessLogic is true)
    persistentField = transientField;
    Luke wrote:
    I have the need to create a non persistable child object in the
    jdoPreStore of a parent object. I then perform some tests on the parent
    to determine if the child object needs to be persisted or not. If I leave
    the child non persistent it still writes to the database.
    I was performing the follwoing piece of code
    Class Parent {
    // The relationship is a 0 to many
    public Child createChild() {
    Child child = .....//create non persistent object
    child.setParent(this);
    getChild().add(child);
    It appears that if I remove the getChild().add(child). It does not
    persist (as desired).
    Is this correct behaviour?? I dont think that it should be, but if it is
    then I have a further problem.
    If that child object inherits from another object and you remove the
    getChild().add(child) kodo outputs an invalid object to the database. It
    doesnt insert a row to the child table. But it inserts a row to the
    childs inherited object table. This is now an invalid object and will
    fail upon loading.
    Any help on this would be appreciated.
    Thanks
    Luke.
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com

  • Issue :  Child view object refresh problem,

    Hi ,
    Child view object refresh problem,
    Detail expaination of problem with DEPT and Emp table:
    I have two pages first.jspx and secound.jspx
    In the First page we are showing one department and All Employee blongs to that department. Employees are shown in table format.
    and i have duplicate button in table--> this will create a duplication record of selected employee by calling application module
    and the control moves to sencound page to show the newly created Employee details.
    From secound form am returning back with some action button to previous page to the same dept , The newly created records are not showing in the table [but the database has newly crated].
    How do i refresh the child view object ?
    Regards,
    Bogi.

    Hi Frank,
    We are creating new record from the AM with help of ADFBC.
    Would like know how to refresh UI Datacollection and AM view objects.. ? i have added vo.executeQuery in AM . But the changes not reflecting in UI,
    Thanks for the reply... am ready to give any other info required,,,

  • Hibernate child cascade delete child???

    i am facing a problem on the cascade delete of a parent object, i try to explain the problem by example.
    Parent object C
    Child object D,E,F
    i want to delete the parent object "delete(c) ".
    before the parent can be deleted the child D,E and F has to be deleted.
    My relations are defined with cascade="all-delete-orphan" in the parent
    object. In my child no cascade is defined.
    When i check the logging on deletion of the object i see that hibernate
    tries to update reference in the child to the parent by setting the value to
    null. But since the the reference is obligated (NOT NULL in database)
    i get a not null constraint violation.
    My first question is why does hibernate not delete the child record instead of updating the reference (since my child object is remove
    from my collection in the parent object)?
    Could some one tell me what i am doing wrong? or does there not exist a solution.
    thnx

    First, is that a typo? The docs for 3.1 that I'm looking at say "all,delete-orphan", but you have "all-delete-orphan".
    Second, I thought (and it's been a long time since I've needed to do this) that you defined the cascading in the child. I could be wrong though.
    What kind of relationship is this? The docs say that delete-orphan only applies to one-to-many.
    You might want to go through the pertinent sections of these if you haven't already:
    http://www.hibernate.org/hib_docs/v3/reference/en/html/mapping.html
    http://www.hibernate.org/hib_docs/v3/reference/en/html/collections.html
    [url http://www.hibernate.org/hib_docs/v3/reference/en/html/objectstate.html#objectstate-transitive]http://www.hibernate.org/hib_docs/v3/reference/en/html/objectstate.html#objectstate-transitive

  • Xdb_installation_trigger does not support object creation of type SNAPSHOT

    hi everyone, i'm using Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit on solaris sparc 5.10
    we like to send an email through SSL, and after searching here and there I found out that oracle DB 11g able to go throught the SSL.
    since upgrade our DB to 11g would not be an option, so i tried to export XDB of 11g and import it into XDB 10gR2 schema, it was a mess...
    then i just reinstall XDB using catnoqm.sql & catqm.sql
    and now one of our programmer cant run some script like above
    CREATE MATERIALIZED VIEW FIFSYS_MKT_SCHEME_MV_COY
    TABLESPACE MARKETING_TABLES
    PCTUSED    40
    PCTFREE    10
    INITRANS   2
    MAXTRANS   255
    STORAGE    (
    INITIAL          64K
    MINEXTENTS       1
    MAXEXTENTS       UNLIMITED
    PCTINCREASE      0
    FREELISTS        1
    FREELIST GROUPS  1
    BUFFER_POOL      DEFAULT
    +)+
    NOCACHE
    LOGGING
    NOCOMPRESS
    NOPARALLEL
    BUILD IMMEDIATE
    REFRESH FORCE ON DEMAND
    WITH PRIMARY KEY
    AS
    +/* Formatted on 9/23/2010 1:07:42 PM (QP5 v5.114.809.3010) */+
    SELECT   coy_id,
    appl_branch_id,
    appl_object_code,
    product_type,
    ppdcf_paid_date,
    SUM (scheme_adm) scheme_adm,
    SUM (appl_unit) appl_unit,
    SYSDATE mkt_sysdate
    FROM   (SELECT   NVL (a.coy_id, '01') coy_id,
    a.branch_id appl_branch_id,
    DECODE (a.buss_unit, 'NMC', '2101', 'UMC', '2102', '2352')
    appl_object_code,
    a.platform product_type,
    TRUNC (c.contract_active_date) ppdcf_paid_date,
    NVL (s.ms_amt, 0) scheme_adm,
    NVL (o.total_item, 0) appl_unit
    FROM   ordmgmt.om_trn_appl_ms_lvl_object s,
    ordmgmt.om_trn_appl_hdr a,
    acctmgmt.ar_trn_sum_contracts c,
    +( SELECT appl_no, COUNT ( * ) total_item+
    FROM   ordmgmt.om_trn_appl_object
    GROUP BY   appl_no) o
    WHERE       s.appl_no = a.appl_no
    AND a.appl_no = o.appl_no
    AND s.ms_code IN ('MS03', 'MS14')
    AND c.appl_no = a.appl_no
    AND c.contract_no = a.contract_no
    +/*AND c.office_code = a.branch_id*/+
    AND NVL (a.coy_id, '01') = NVL (c.coy_id, '01'))
    GROUP BY   coy_id,
    appl_branch_id,
    appl_object_code,
    product_type,
    ppdcf_paid_date;
    COMMENT ON MATERIALIZED VIEW FIFSYS_MKT_SCHEME_MV_COY IS 'snapshot table for snapshot MARKETING.FIFSYS_MKT_SCHEME_MV_COY';
    and this error shown:
    ORA-00604 error occurred at recursive SQL level 1
    ORA-20000 Trigger xdb_installation_trigger does not support object creation of type SNAPSHOT
    ORA-06512 at line 32
    maybe some of you know how to solve this problem??
    and, this in the script of the xdb_installation_trigger
    DROP TRIGGER SYS.XDB_INSTALLATION_TRIGGER;
    CREATE OR REPLACE TRIGGER SYS.xdb_installation_trigger
    BEFORE
    CREATE ON DATABASE
    DECLARE
    sql_text varchar2(200);
    val number;
    BEGIN
    if (dictionary_obj_owner != 'XDB') then
    if (dictionary_obj_type = 'FUNCTION' or
    dictionary_obj_type = 'INDEX' or
    dictionary_obj_type = 'PACKAGE' or
    dictionary_obj_type = 'PACKAGE BODY' or
    dictionary_obj_type = 'PROCEDURE' or
    dictionary_obj_type = 'SYNONYM' or
    dictionary_obj_type = 'TABLE' or
    dictionary_obj_type = 'TABLESPACE' or
    dictionary_obj_type = 'TYPE' or
    dictionary_obj_type = 'VIEW' or
    dictionary_obj_type = 'USER'
    +)then+
    if (dictionary_obj_type  != 'PACKAGE BODY'
    +) then+
    sql_text := 'select count(*) from ALL_OBJECTS where owner = :1 and object_name = :2 and object_type = :3';
    execute immediate sql_text into val using dictionary_obj_owner, dictionary_obj_name, dictionary_obj_type;
    if (val = 0) then
    sql_text := 'select count(*) from dropped_xdb_instll_tab where owner = :1 and object_name = :2 and object_type = :3';
    execute immediate sql_text into val using dictionary_obj_owner, dictionary_obj_name, dictionary_obj_type;
    if (val = 0) then
    insert into xdb_installation_tab values
    +(dictionary_obj_owner, dictionary_obj_name, dictionary_obj_type);+
    end if;
    end if;
    end if;
    else
    raise_application_error(-20000, 'Trigger xdb_installation_trigger does not support object creation of type '||dictionary_obj_type);
    end if;
    end if;
    end;
    +/+
    /********************************************************************************/

    i'm so careless, after checking a fresh installation of the same version DB, i dont found xdb_installation_trigger.
    so just by simply remove that trigger & everything works just fine. :)

  • XML Document object access problem?

    Hi,
    I have created a servlet,which will call .sh file, which will call java application.........
    this java application is working as a search engine,which will do search in the XML document object...........This is working fine when only one user run this servlet...........But when more than servlet do the same it is not working......... But once first servlet create the Document object,which is main source for serching..........then second servlet will work fine.......same thing with third servlet and so on...... I used the thread.sleep()/synchronize but it is not working...bcoz i am accessing the same application.....Then instead of servlet i tried to run the java application from the Dos prompt..........But i am facing the same problem......So pl guide me bcoz everything is working excluding this..........Becoz this document object creation is taking some time........ i am creating the object shown below
    Document doc =parseXmlFile("Article.xml", false);
    Element docElem = doc.getDocumentElement();
    public static org.w3c.dom.Document parseXmlFile(String filename, boolean validating)
                   try {
         // Create a builder factory
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
         factory.setValidating(validating);
         // Create the builder and parse the file
         // org.w3c.dom.Document doc = factory.newDocumentBuilder().parse(filename);
         org.w3c.dom.Document doc = factory.newDocumentBuilder().parse(new File(filename));
         return doc;
    } catch (SAXException e) {
    // A parsing error occurred; the xml input is not valid
    } catch (ParserConfigurationException e) {
    } catch (IOException e) {
    return null;
    }

    Hi,
    This is my Servlet code..............
    package PW.Feed;
    import java.io.*;
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.StreamResult;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.util.*;
    public class PrintDom extends HttpServlet
         Document doc;
         Element docElem;
         Connection Conn=null;
         Statement stmt=null,stmt1=null;
         ResultSet rs1=null,rs=null;
         PrintWriter out;
         Vector myVector1=new Vector();
         Vector myVector2=new Vector();
         String strSql="";
         public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException
              res.setContentType("text/html");
              out=res.getWriter();
              try
                   String pubtype=req.getParameter("PubType");
                   String pubDate=req.getParameter("PubDate");
                   String toDate=req.getParameter("ToDate");
                   String fromDate=req.getParameter("FromDate");
                   if(pubDate==null)pubDate="2";
                   if(toDate==null)toDate="02/09/2005";
                   if(fromDate==null)fromDate="02/08/2005";
                   Class.forName("org.firebirdsql.jdbc.FBDriver");
                   Conn = DriverManager.getConnection("jdbc:firebirdsql:192.168.0.15/3050:D:/FBDatabases/PW1.GDB","SYSDBA","cohezia");
                   //Conn = DriverManager.getConnection("jdbc:firebirdsql:192.168.0.99/3050:/share/pw1.gdb","SYSDBA","cohezia");
                   stmt = Conn.createStatement( );
                   if(pubDate.equals("2"))
                        strSql="Select sh.ARTICLEID,sh.cuttingsdate,sh.READDATE,sh.headline,sh.SUMMARY,sh.AUTHOR,sh.PAGEFROM,sh.PUB_NAME,sh.READER_NAME,sh.PARENTTITLE,sh.CANMAIL,sh.PUBLICATION_ID,sh.JOURNALIST_ID,sh.ISPDF FROM SCANSHEADER sh,PUBLICATIONS p where sh.publication_id=p.publication_id and sh.readdate>'"+fromDate+"' and sh.readdate<'"+toDate+"' and p.pubtype='"+ pubtype +"' order by sh.ARTICLEID";
                   else
                        strSql="Select sh.ARTICLEID,sh.cuttingsdate,sh.READDATE,sh.headline,sh.SUMMARY,sh.AUTHOR,sh.PAGEFROM,sh.PUB_NAME,sh.READER_NAME,sh.PARENTTITLE,sh.CANMAIL,sh.PUBLICATION_ID,sh.JOURNALIST_ID,sh.ISPDF FROM SCANSHEADER sh,PUBLICATIONS p where sh.publication_id=p.publication_id and sh.cuttingsdate>'"+fromDate+"' and sh.cuttingsdate<'"+toDate+"' and p.pubtype='"+ pubtype +"' order by sh.ARTICLEID";
                   rs=stmt.executeQuery(strSql);
                   DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
                   doc = builder.newDocument();
                   docElem = doc.createElement("RECORDLIST");
                   doc.appendChild(docElem);
                   Element rootElem = doc.createElement("RECORDS");
                   docElem.appendChild(rootElem);
                   String artid="";
                   while(rs.next())
                             Element artElem = doc.createElement("RECORD");
                             if((rs.getString("ARTICLEID")).length()>0)artElem.setAttribute("id",rs.getString("ARTICLEID"));
                             rootElem.appendChild(artElem);
                             Element rootFieldElem = doc.createElement("FIELDS");
                             artElem.appendChild(rootFieldElem);
                             Element eleCuttingDate = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleCuttingDate);
                             eleCuttingDate.setAttribute("fieldName","CUTTINGSDATE");
                             if((rs.getString("CUTTINGSDATE")).length()>0) eleCuttingDate.appendChild(doc.createTextNode(rs.getString("CUTTINGSDATE")));
                             Element eleReadDate = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleReadDate);
                             eleReadDate.setAttribute("fieldName","READDATE");
                             if((rs.getString("READDATE")).length()>0) eleReadDate.appendChild(doc.createTextNode(rs.getString("READDATE")));
                             Element eleHeadLine = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleHeadLine);
                             eleHeadLine.setAttribute("fieldName","HEADLINE");
                             if((rs.getString("HEADLINE")).length()>0) eleHeadLine.appendChild(doc.createTextNode(rs.getString("HEADLINE")));
                             Element eleSummary = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleSummary);
                             eleSummary.setAttribute("fieldName","SUMMARY");
                             if(rs.getString("SUMMARY")==null){
                                  //out.println("String is null");
                                  else
                                  {eleSummary.appendChild(doc.createTextNode(rs.getString("SUMMARY")));}
                             Element eleAuthor = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleAuthor);
                             eleAuthor.setAttribute("fieldName","AUTHOR");
                             if((rs.getString("AUTHOR")).length()>0) eleAuthor.appendChild(doc.createTextNode(rs.getString("AUTHOR")));
                             Element elePageFrom = doc.createElement("FIELD");
                             rootFieldElem.appendChild(elePageFrom);
                             elePageFrom.setAttribute("fieldName","PAGEFROM");
                             if((rs.getString("PAGEFROM")).length()>0) elePageFrom.appendChild(doc.createTextNode(rs.getString("PAGEFROM")));
                             Element elePubName = doc.createElement("FIELD");
                             rootFieldElem.appendChild(elePubName);
                             elePubName.setAttribute("fieldName","PUBNAME");
                             if((rs.getString("PUB_NAME")).length()>0) elePubName.appendChild(doc.createTextNode(rs.getString("PUB_NAME")));
                             Element eleReaderName = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleReaderName);
                             eleReaderName.setAttribute("fieldName","READER NAME");
                             if((rs.getString("READER_NAME")).length()>0) eleReaderName.appendChild(doc.createTextNode(rs.getString("READER_NAME")));
                             Element eleParentTitle = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleParentTitle);
                             eleParentTitle.setAttribute("fieldName","PARENTTITLE");
                             if((rs.getString("PARENTTITLE")).length()>0)eleParentTitle.appendChild(doc.createTextNode(rs.getString("PARENTTITLE")));
                             Element eleCanMail = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleCanMail);
                             eleCanMail.setAttribute("fieldName","CANMAIL");
                             if((rs.getString("CANMAIL")).length()>0) eleCanMail.appendChild(doc.createTextNode(rs.getString("CANMAIL")));
                             Element elePublicationID = doc.createElement("FIELD");
                             rootFieldElem.appendChild(elePublicationID);
                             elePublicationID.setAttribute("fieldName","PUBLICATION_ID");
                             if((rs.getString("PUBLICATION_ID")).length()>0) elePublicationID.appendChild(doc.createTextNode(rs.getString("PUBLICATION_ID")));
                             Element eleJournlistID = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleJournlistID);
                             eleJournlistID.setAttribute("fieldName","JOURNALIST_ID");
                             if((rs.getString("JOURNALIST_ID")).length()>0) eleJournlistID.appendChild(doc.createTextNode(rs.getString("JOURNALIST_ID")));
                             Element eleIspdf = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleIspdf);
                             eleIspdf.setAttribute("fieldName","ISPDF");
                             if((rs.getString("ISPDF")).length()>0) eleIspdf.appendChild(doc.createTextNode(rs.getString("ISPDF")));
                             Element rootKeyElem=doc.createElement("KEYWORDS_CODES");
                        String[] arrCodes=getKeyCodes(rs.getString("ARTICLEID"));
                        int count1 = myVector1.size();
                        String[] myArray1=new String[count1];
                        myVector1.copyInto(myArray1);
                        int count2 = myVector2.size();
                        String[] myArray2=new String[count2];
                        myVector2.copyInto(myArray2);
                        for(int j=0;j<arrCodes.length;j++)
                             Element eleKeyword= doc.createElement("KEYWORD_CODE");
                             eleKeyword.setAttribute("CodeId",arrCodes[j]);
                             eleKeyword.setAttribute("LongName",myArray1[j]);
                             eleKeyword.setAttribute("CodeType",myArray2[j]);
                             rootKeyElem.appendChild(eleKeyword);
                        artElem.appendChild(rootKeyElem);
                   Source source = new DOMSource(docElem);
                   //File file = new File("/share/PrintDom.xml");
                   StringWriter rw=new StringWriter();
                   Result result = new StreamResult(rw);
                   //Result result = new DOMResult();
                   // Write the DOM document to the file
                   Transformer xformer = TransformerFactory.newInstance().newTransformer();
                   xformer.transform(source, result);
                   out.println(rw);
              catch (ClassNotFoundException e)
                        out.println("Unable to load Driver Class" + e);
                        return;
                        //fileLog.log(e,"PressWatchFrame1.PressWatchFrame1()");
              catch (SQLException se)
                   out.println(se);
              catch (Exception e)
                   out.println(e);
    finally{
                        try{
                             if(Conn!=null) Conn.close();
                        catch(SQLException ignored){}
         public String[] getKeyCodes(String strArticleId)
              Vector myVector=new Vector();
              myVector1.removeAllElements();
              myVector2.removeAllElements();
         try{
              stmt1=Conn.createStatement( );
              //String strSql1="Select codeid FROM SCANSSUBJECT where articleid='"+ strArticleId +"'";
              String strSql1="Select ss.codeid,c.longname,c.codetype FROM SCANSSUBJECT ss,CODES c where ss.codeid=c.codeid and articleid='"+ strArticleId +"'";
              rs1=stmt1.executeQuery(strSql1);
              String strCodes="";
              while(rs1.next())
                   myVector.add(rs1.getString("codeid"));
                   myVector1.add(rs1.getString("longname"));
                   myVector2.add(rs1.getString("codetype"));
              }catch (SQLException se)
                                       out.println(se);
              int count = myVector.size();
              String[] myArray = new String[count];
              myVector.copyInto(myArray);
              return myArray;
    ..................Thanx

  • Filtering not working for newly added child objects in master-detail table

    Hi,
    I am using Jdeveloper 11.1.1.4 version.
    Problem scenario:
    Filtering of records is not working for newly created child objects in a master-detail scenario.
    Steps to reproduce this issue using HR Schema (using LOCATIONS and DEPARTMENTS table ) :
    1. Create Business components (EO's & VO's ) for LOCATIONS & DEPARTMENTS table)
    1. Create a .jspx page and insert a readonly master table of Locations
    2. Insert a child table (inline-edit table) of Departments and enable filtering
    4. For the child table, drag and drop CreateInsert operation as a toolbar button .
    5. Create a new child record using the toolbar button and enter data .
    6. Filtering on the newly created child record's attributes does not work.
    Please note that the same filter works for existing child records.
    Any suggestions for resolving this issue?
    Thanks,
    Vikas

    Found from Fusion Developer's Guide the following snippet about QBE functionality :
    "+When you create data controls, all data collections will automatically include a Named Criteria node with an All Queriable Attributes criteria. This is the default view criteria that includes all the searchable attributes or columns of the data collection. You cannot edit or modify this view criteria+. "
    So, the question is if the implicit view criteria cannot be edited, how else to set the query execution mode to "Both" ?
    Shouldn't ADF BC support this by default? Is this a bug?
    Note:- If you create a maste-detail table using POJO datacontrols, filter works correctly for newly created child records also .
    This seems to be an issue with ADF-BC datacontrols only.
    Thanks,
    Vikas

  • Use String Variable in New Object Creation

    Thanks to those who review and respond. I am new to Java, so please be patient with my terminoloy mistakes and fumblings. I am reading in a file and I want to create a new object based on specific field (car for example). As you will notice I grab field 8 here label sIID.
    String sIID = dts.group(8);
    BTW this regex grouping works fine. The problem is seen when I try to use the sIID variable in my new object creation process.
    DateParse sIID = new DateParse();
    My IDE is reporting "Variable sIID is already defined in the scope"
    Is this possible? The assumption is that the sIID will have different value during the processing of the file. For example, car could mean truck, sedan, etc with operators like color, number of doors, mileage, top speed, etc.

    Thanks for the reply. I have include similar and much shorter code for the sake of brevity.
    My problems are centered around the x variable/object below. Ideally this would translate to three objects PersonA, PersonB, etc that I could reference later in the code as PersonA.newname if I wanted to. Hopefully this makes sense.
    public class TestingObjects {
      public static void main(String[] argv) {
           String [] names;
           names = new String[3];
           names[0] = "PersonA";
           names[1] = "PersonB";
           names[2] = "PersonC";
           for (String x:names) {
             PN x = new PN();  // <- Problem
             x.name = x;
             x.SayName();
            System.out.println(x.newname);
    public class PN {
           String name;
           String newname;
      public String SayName() {
           newname = "Name = " + name;
           System.out.println(name);
          return newname;
    }

  • MXML Dynamic Object Creation

    Hi ,
    Static Object Creation :
    Eg:
        <mx:Fade id="ViewStack_EffectStart" duration="500" alphaFrom="0.0" alphaTo="1.0"/>
        <mx:Fade id="ViewStack_EffectEnd" duration="500" alphaFrom="1.0" alphaTo="0.0"/>
    <comp:ErrorBox id="errorBox" active="{active}" showEffect="{ViewStack_EffectStart}" hideEffect="{ViewStack_EffectEnd}"/> .
    The above static objects is working fine, but the problem is that we have lot of similiar static object which creates a memory issue.If we create dynamic objects, will it avoid the issue.Is dynamic objects advisible?.
    Thanks in advance.Please reply ASAP.
    Thanks ,
    San.

    hmn.. I don't understand your questions fully.
    What about create the fade object in "Model" and reference the same Fade object for all dynamic objects?
    or r u asking to find out how to create fade in actionscript?
    var fade:Fade = new Fade();
    fade.target = this;
    fade.alphaFrom = 0;
    fade.alphaTo = 1;
    fade.play();
    hope this helps,
    BaBo,

  • JVM 1.5.0, parallelism and object creation

    Hi.
    I am currently running Java 1.5.0 on a production server. This server is a 4-cpu 2gb ram beast running Red Hat ES 3. It provides MySQL backend and a Java server to be accessed through a Flash client.
    So far, the Flash client fares well. MySQL takes worst cast 16% of one CPU for very heavy selections. But I am having problems with optimizing the Java part that does everything.
    First and foremost, I cannot change the way it is. Our java code is mostly vendor code, thus we can't really expect to be able to easily change the code. Whatever code we added to the vendor code is definitely not the bottleneck, it's optimized, it's properly synchronized and it's very effective.
    I would like to give you an idea of how things fares. You will see my problem soon.
    - I am running one process of Java. This process is -Xms and Xmx'ed to 384 megs.
    - The total DSize of the Java environment is more than a gigabyte due to the 1000+ threads that runs through it. More so, every client that runs through it adds up at least two threads.
    - There are massive object creation and destruction happening. For a 100-client system, the "eden" memory is filled up and GC'ed at least twice per second. Since 1.5.0, the "old" memory of 384m gets filled up in 10 minutes, and GC'ed at that point.
    - CPU usage is having fun between 80% and 150% of one CPU (remember I have 4 CPUs so 150% is 150/400% total usage)
    - GC is the major speed bump for my server, as if I put 768 megs of Xmm instead of 384, cpu usage drops to 60%-90% CPU, that is, until memory gets filled up and swap gets used (do the math: 768m + 1200 thread stacks)
    Now it works fine. 100 users, it's perfect. My major problem is that from next week on, we are planning 300+ users. Ouch.
    So my few questions are:
    - In knowing that garbage must constantly be collected, is there something I can do in the environment to make it happen all the time in background? Or am I bound to have all 4 cpu's stopped momentarily twice per second so that it might happen?
    - In 1.4.x, I could change "eden" memory block size. It doesn't seem to be the same for 1.5.x. What's up with that? I used to increase it dramatically, making GC longer but less frequent, increasing parallelism force.
    I am asking the questions because I am not in position of trying "what if"s with my production server. The test server handles well our 8 internal users ... but we are not close of making the same amount of request as our 100-users production server... so we cannot reliably try out options. Best case is see if it crashes or now.
    Thanks
    Mike

    Mikle -- please make sure that you are using either the
    UseParallelGC collector or the UseConcMarkSweepCollector.
    Both would appear to address some of the problems you
    mention.
    You may need to tune the size of the young generation
    explicitly. Check out the GC tuning documents/tips
    at:
    http://java.sun.com/docs/hotspot
    You should make sure your application is not paging.
    Since the default thread stack sizes are large (2 MB?)
    and you may not need that much, you can try -Xss256k
    (for example) to reduce the virtual memory requirements
    for your thread stacks and free up more address space
    for the Java heap.
    In the end, for an application of the kind you describe you
    probably need to go 64-bit and use a larger Java heap
    along with the parallel/concurrent collector to deal with the
    attendant GC overheads. That (going 64-bit) should be easy
    (trivial) if your application is pure Java.
    Hi.
    I am currently running Java 1.5.0 on a production
    server. This server is a 4-cpu 2gb ram beast running
    Red Hat ES 3. It provides MySQL backend and a Java
    server to be accessed through a Flash client.
    So far, the Flash client fares well. MySQL takes worst
    cast 16% of one CPU for very heavy selections. But I
    am having problems with optimizing the Java part that
    does everything.
    First and foremost, I cannot change the way it is. Our
    java code is mostly vendor code, thus we can't really
    expect to be able to easily change the code. Whatever
    code we added to the vendor code is definitely not the
    bottleneck, it's optimized, it's properly synchronized
    and it's very effective.
    I would like to give you an idea of how things fares.
    You will see my problem soon.
    - I am running one process of Java. This process is
    -Xms and Xmx'ed to 384 megs.
    - The total DSize of the Java environment is more than
    a gigabyte due to the 1000+ threads that runs through
    it. More so, every client that runs through it adds up
    at least two threads.
    - There are massive object creation and destruction
    happening. For a 100-client system, the "eden" memory
    is filled up and GC'ed at least twice per second.
    Since 1.5.0, the "old" memory of 384m gets filled up
    in 10 minutes, and GC'ed at that point.
    - CPU usage is having fun between 80% and 150% of one
    CPU (remember I have 4 CPUs so 150% is 150/400% total
    usage)
    - GC is the major speed bump for my server, as if I
    put 768 megs of Xmm instead of 384, cpu usage drops to
    60%-90% CPU, that is, until memory gets filled up and
    swap gets used (do the math: 768m + 1200 thread
    stacks)
    Now it works fine. 100 users, it's perfect. My major
    problem is that from next week on, we are planning
    300+ users. Ouch.
    So my few questions are:
    - In knowing that garbage must constantly be
    collected, is there something I can do in the
    environment to make it happen all the time in
    background? Or am I bound to have all 4 cpu's stopped
    momentarily twice per second so that it might happen?
    - In 1.4.x, I could change "eden" memory block size.
    It doesn't seem to be the same for 1.5.x. What's up
    with that? I used to increase it dramatically, making
    GC longer but less frequent, increasing parallelism
    force.
    I am asking the questions because I am not in position
    of trying "what if"s with my production server. The
    test server handles well our 8 internal users ... but
    we are not close of making the same amount of request
    as our 100-users production server... so we cannot
    reliably try out options. Best case is see if it
    crashes or now.
    Thanks
    Mike

  • Oracle 8i Lite: Command Object Creation Failed

    Hi Everyone,
    I use Windows XP everything works except navigator and I get the message that Command Object Creation Failed
    Does Anyone know how to fix this and I have to use 8i Lite as it for a school database project
    Thanks in advance for everyone's help
    J S

    Hi. I know this response is too many years late, but I'm putting it in case someone (like me a few days ago) needs to connect to a legacy server using legacy tools:
    This error is caused by the installer, sometimes it does not adequately register the OLE/COM objects provided in nav8cmd.dll
    So, to correct it:
    - open a command window
    - change to the directory where the navigator program files reside (In my case c:\orant\bin)
    - type the following command: regsvr32 nav8cmd.dll
    You should receive a message that the DLL was correctly registered. After that you can use the navigator without problems.
    Cheers.

  • How to reference ALL child objects?

    How can I reference ( ALL ) child objects.... for example in
    an objects constructor I have applied mouse movement events. But
    how could I also code - "apply mousemove events to ALL children of
    this object". ?
    Note - these child objects have been added AFTER compilation
    via the addChild method. They are not children created using
    inheritance.

    What is it that you're trying to accomplish?
    What problem is it that you have, where you think the solution is to get a list of every instantiated object?
    What are you planning to do with that list?
    Even a very small, short-lived program can easily create hundreds or thousands of objects during its lifetime, so it's unlikely that a complete list will be of any practical use.
    If you want to observe, for example, which objects are consuming the majority of your memory because you're trying to reduce the memory footprint, you could use a profiler, such as JProbe, JProfiler, OptimizeIt, or VisualVM.

Maybe you are looking for