Delete view object with multiple updateable entities

I've created a VO which updates 3 entities, taking care of the posting order by overriding the postChanges(TransactionEvent e) and the create() methods of the entities, and of the VOs RowImpl.
The problem is, the DELETE is not working, I'm getting a database constraint violation (raised like you should delete the row in the EMP table first, and then its parent row in the DEP table).
I've inserted the following in the e.g. EmployeeImpl.java
if (getPostState() == STATUS_DELETED) {
DepImpl parentDep = getDepartments();
if (parentDep != null ) {
parentDep.postChanges(e);
and it's not enough, I'm missing smth obviously.
Can someone help?
Thanks and regards
gabriela

Shailesh,
thank you for your reply.
I'm back from the holidays and trying to keep up :-)
Guess I had gotten it wrong in the beginning. This is how it looks like now:
* Remove the instance present on associations which are 1:1 relationships,
* (on delete cascade behaviour).
* The default implementation of remove() only removes this instance.
public void remove() {
//Get the Person Id and delete the associated Parties instance first
Number perId = getId().getSequenceNumber();
if (perId != null)
DBTransaction trans = getDBTransaction();
trans.executeCommand("delete from parties where per_id = " + perId);
//delete this instance
super.remove();
best regards
gabriela

Similar Messages

  • Implementing a view Object with Multiple Updateable Dependent Entity Objects

    Hello,
         I want to implement view object with multiple updateable entity object,
         i have refered this link its good https://forums.oracle.com/thread/63721
         here they have explained with 2 table,
         but when we have more then 5 tables and each table have Primary keys , Foreign key , Sequence and  trigger created on it. Then whats steps should i want to fallow.
         if possible some please provide the link or some one help me out how to do this .
         thanks in advance
         cheers

    Has the Advanced View Object Techniques been referred?

  • Problem: View Object with Multiple Updateable Dependent Entity Objects

    I try to implement a ViewObject with 2 updateable entities based on the document:
    http://www.oracle.com/technology/products/jdev/howtos/bc4j/multientityvo.html
    But I get an early NullPointerException:
    As written in the document I overriden the create method in the ViewObjectRowImpl class:
    protected void create(AttributeList attributeList) {
    // The BC4J framework will already have created "blank" entity instances
    System.out.println(getClass().getName()+"create BEGIN");
    LabEventTypeItemImpl newLabEventTypeItem = this.getLabEventTypeItem();
    System.out.println(getClass().getName()+"create 1");
    TariffItemImpl newTariffItem = this.getTariffItem();
    System.out.println(getClass().getName()+"create 2");
    try {
    // Let department "blank" entity instance to do programmatic defaulting
    newLabEventTypeItem.create(attributeList);
    System.out.println(getClass().getName()+"create 3");
    // Let employee "blank" entity instance to do programmatic defaulting
    // passing in new DepartmentImpl instance so its attributes are
    if (newTariffItem == null) // added trace
    System.out.println(getClass().getName()+"create newTariffItem IS NULLLLL");
    // available to the EmployeeImpl's create method.
    newTariffItem.create(newLabEventTypeItem);
    System.out.println(getClass().getName()+"create 4");
    catch (JboException ex) {
    if (newLabEventTypeItem != null)
    newLabEventTypeItem.revert();
    if (newTariffItem != null)
    newTariffItem.revert();
    throw ex;
    catch (Exception otherEx) {
    if (newLabEventTypeItem != null)
    newLabEventTypeItem.revert();
    if (newTariffItem != null)
    newTariffItem.revert();
    throw new RowCreateException(true /* EO Row? */,
    "LabEventTypeItem" /* EO Name */,
    otherEx /* Details */);
    System.out.println(getClass().getName()+"create END");
    The code:
    TariffItemImpl newTariffItem = this.getTariffItem();
    is equivalent in the example to:
    EmployeeImpl newEmployee = getEmployee();
    In my case this.getTariffItem() <=> getEmployee() returns null?
    I get an Exception when I call:
    newTariffItem.create(newLabEventTypeItem);
    Equivalent to:
    newEmployee.create(newDepartment);
    ViewObject partial XML:
    ======================
    <DesignTime>
    <Attr Name="_isCodegen" Value="true" />
    <Attr Name="_version" Value="10.1.2.17.96" />
    <Attr Name="_codeGenFlag2" Value="Access|Coll|Msg" />
    <Attr Name="_isExpertMode" Value="false" />
    </DesignTime>
    <EntityUsage
    Name="LabEventTypeItem"
    Entity="com.photoswing.model.lab.LabEventTypeItem" >
    <DesignTime>
    <Attr Name="_EntireObjectTable" Value="false" />
    <Attr Name="_queryClause" Value="true" />
    <Attr Name="_queryWhere" Value="(((LabEventTypeItem.LAB_EVENT_TYPE_ITEM_ID = TariffItem.LAB_EVENT_TYPE_ITEM_ID)AND (LabEventTypeItem.ITEM_ID = Item.ITEM_ID))AND (LabEventTypeItem.PRINT_SIZE_DPI_ID = PrintSizeDpi.PRINT_SIZE_DPI_ID(+)))AND (LabEventTypeItem.FILM_PRINT_SIZE_DPI_ID = FilmPrintSizeDpi.FILM_PRINT_SIZE_DPI_ID(+))" />
    <Attr Name="_queryOrderBy" Value="Item.ITEM_TYPE_ID,PrintSizeDpi.REQ_MEGA_PIXELS,Item.ITEM_ID" />
    </DesignTime>
    </EntityUsage>
    <EntityUsage
    Name="TariffItem"
    Entity="com.photoswing.model.lab.TariffItem"
    Association="com.photoswing.model.lab.TariffItemLabEventTypeItemFkAssoc"
    AssociationEnd="com.photoswing.model.lab.TariffItemLabEventTypeItemFkAssoc.TariffItemLabEventTypeItem"
    SourceUsage="com.photoswing.model.lab.LabEventTypeItemAndTariffItemVO.LabEventTypeItem"
    Reference="true" >
    <DesignTime>
    <Attr Name="_EntireObjectTable" Value="false" />
    <Attr Name="_queryClause" Value="false" />
    <AttrArray Name="_srcAttributes">
    <Item Value="com.photoswing.model.lab.LabEventTypeItem.LabEventTypeItemId" />
    </AttrArray>
    <AttrArray Name="_dstAttributes">
    <Item Value="com.photoswing.model.lab.TariffItem.LabEventTypeItemId" />
    </AttrArray>
    </DesignTime>
    </EntityUsage>
    Stack trace:
    ===========
    oracle.jbo.RowCreateException: JBO-25017: Error while creating a new entity row for LabEventTypeItem.
         at com.photoswing.model.lab.LabEventTypeItemAndTariffItemVORowImpl.create(LabEventTypeItemAndTariffItemVORowImpl.java:1370)
         at oracle.jbo.server.ViewRowImpl.callCreate(ViewRowImpl.java:353)
         at oracle.jbo.server.ViewObjectImpl.createInstance(ViewObjectImpl.java:2599)
         at oracle.jbo.server.QueryCollection.createRowWithEntities(QueryCollection.java:1048)
         at oracle.jbo.server.ViewRowSetImpl.createRowWithEntities(ViewRowSetImpl.java:1725)
         at oracle.jbo.server.ViewRowSetImpl.doCreateAndInitRow(ViewRowSetImpl.java:1769)
         at oracle.jbo.server.ViewRowSetImpl.createRow(ViewRowSetImpl.java:1749)
         at oracle.jbo.server.ViewObjectImpl.createRow(ViewObjectImpl.java:6230)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:891)
         at oracle.jbo.uicli.jui.JUActionBinding.doIt(JUActionBinding.java:203)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:478)
         at oracle.jbo.uicli.controls.JUNavigationBar.doAction(JUNavigationBar.java:306)
         at com.photoswing.component.JUNavBar.doAction(JUNavBar.java:1114)
         at oracle.jbo.uicli.controls.JUNavigationBar.actionPerformed(JUNavigationBar.java:259)
         at com.photoswing.component.JUNavBar.actionPerformed(JUNavBar.java:419)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
         at java.awt.Component.processMouseEvent(Component.java:5100)
         at java.awt.Component.processEvent(Component.java:4897)
         at java.awt.Container.processEvent(Container.java:1569)
         at java.awt.Component.dispatchEventImpl(Component.java:3615)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
         at java.awt.Container.dispatchEventImpl(Container.java:1613)
         at java.awt.Window.dispatchEventImpl(Window.java)
         at java.awt.Component.dispatchEvent(Component.java)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:458)
         at com.photoswing.view.start.WaitCursorEventQueue.dispatchEvent(PhotoWebshopDesktop.java:3077)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    ## Detail 0 ##
    java.lang.NullPointerException
         at com.photoswing.model.lab.LabEventTypeItemAndTariffItemVORowImpl.create(LabEventTypeItemAndTariffItemVORowImpl.java:1355)
         at oracle.jbo.server.ViewRowImpl.callCreate(ViewRowImpl.java:353)
         at oracle.jbo.server.ViewObjectImpl.createInstance(ViewObjectImpl.java:2599)
         at oracle.jbo.server.QueryCollection.createRowWithEntities(QueryCollection.java:1048)
         at oracle.jbo.server.ViewRowSetImpl.createRowWithEntities(ViewRowSetImpl.java:1725)
         at oracle.jbo.server.ViewRowSetImpl.doCreateAndInitRow(ViewRowSetImpl.java:1769)
         at oracle.jbo.server.ViewRowSetImpl.createRow(ViewRowSetImpl.java:1749)
         at oracle.jbo.server.ViewObjectImpl.createRow(ViewObjectImpl.java:6230)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:891)
         at oracle.jbo.uicli.jui.JUActionBinding.doIt(JUActionBinding.java:203)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:478)
         at oracle.jbo.uicli.controls.JUNavigationBar.doAction(JUNavigationBar.java:306)
         at com.photoswing.component.JUNavBar.doAction(JUNavBar.java:1114)
         at oracle.jbo.uicli.controls.JUNavigationBar.actionPerformed(JUNavigationBar.java:259)
         at com.photoswing.component.JUNavBar.actionPerformed(JUNavBar.java:419)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
         at java.awt.Component.processMouseEvent(Component.java:5100)
         at java.awt.Component.processEvent(Component.java:4897)
         at java.awt.Container.processEvent(Container.java:1569)
         at java.awt.Component.dispatchEventImpl(Component.java:3615)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
         at java.awt.Container.dispatchEventImpl(Container.java:1613)
         at java.awt.Window.dispatchEventImpl(Window.java)
         at java.awt.Component.dispatchEvent(Component.java)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:458)
         at com.photoswing.view.start.WaitCursorEventQueue.dispatchEvent(PhotoWebshopDesktop.java:3077)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    Thanks
    Frederic

    I get the same error on the scott schema:
    protected void create(AttributeList attributeList) {
    // The BC4J framework will already have created "blank" entity instances
    DeptImpl newDept = getDept();
    EmpImpl newEmp = getEmp();
    try {
    // Let dept "blank" entity instance to do programmatic defaulting
    newDept.create(attributeList);
    // Let emp "blank" entity instance to do programmatic defaulting
    // passing in new DeptImpl instance so its attributes are
    // available to the EmpImpl's create method.
    if (newEmp == null)
    System.out.println(getClass().getName()+".create newEmp IS NULL");
    newEmp.create(newDept);
    catch (JboException ex) {
    newDept.revert();
    newEmp.revert();
    throw ex;
    catch (Exception otherEx) {
    newDept.revert();
    newEmp.revert();
    throw new RowCreateException(true /* EO Row? */,
    "Dept" /* EO Name */,
    otherEx /* Details */);
    The trace shows:
    model.CreateDepartmentAndFirstEmployeeRowImpl.create newEmp IS NULL
    Another problem:
    Refreshing Foreign Key Values in New Employees Once Final Department Id is Assigned:
    Number newDeptno = getDeptno().getSequenceNumber();
    doesn't compile getSequenceNumber() unknown.
    I send you a usecase as a zip file.
    The code for Refreshing Foreign Key in is comment at the end of the DeptImpl file.
    Regards
    Frederic
    I send you the

  • View Object with Multiple updatable entities

    Hi all
    I'm using JDeveloper 11g, and ADF BC.
    I have a view object based on 5 entities and 3 of them are updatable. If I execute create of the view object, just the first entity is created. I've been searching some information and I have found this
    http://download.oracle.com/docs/html/B25947_01/bcadvvo009.htm#CEGCAJCI
    In the explample it says // The view row will already have created "blank" entity instances, but instead of having blank entity instances i'm getting null.
    Any help?
    Thank you
    Joseba

    Uncheck "Reference" for every Entity that you want to be created anew when you create a new row.
    When you check "Reference" then the framework will try to find the referenced entities in the entity cache and the database, but will not create new ones during row creation.
    Sascha

  • Implement a View Object with multiple entity objects

    Hi
    In 'How to' section on the 'otn.oracle.com' (Jdeveloper) web site is tutorial how to implement a View Object with multiple updateable dependent entity objects.
    It allows user to insert an employee and a department at the same time.
    But I would like to change this example to insert a new department only if it does not already exist. How to change this sample?
    Is there any other way to this?
    Thanks
    Regards
    Gorazd

    Once again the structure, sorry.
    ViewObject
    |-ParentEntityObject
    ..|-PId
    ..|-PAttribute
    ..|-CId (FK)
    |-ParentChildAssociation
    |-ChildEntityObject
    ..|-CId
    ..|-CAttribute
    Christian

  • BC4J: problems creating view object with multiple entity objects

    Hi,
    I working with a view object which contains two entity objects with parent-child relationship like this:
    ViewObject - ParentEntityObject - PId
    PAttribute
    CId (FK)
    (- ParentChildAssociation)
    - ChildEntityObject - CId
    - CAttribute
    The 'Read Only' and 'References' options are checked for the association in the view object.
    I'm creating a new row using this view object. The parent object should be created new and the child object already exists in the database, so I'm setting only the attributes of the parent object (including foreign key).
    After creating the row I display it in a jbo:DataTable and only those attributes coming from the parent object are displayed. The attributes of the child object are not set. After a commit all attributes appear.
    The problem is, that I want to display the new row with all attributes to the users BEFORE they commit.
    I tried to set the child attributes, but they are read only by definition and even when I unchecked the 'Read Only' option and set the attributes to 'Always Updateable' in the view object it is giving me
    JBO-27008: Attribute set for CAttribute in view object ViewObject failed.
    Is there a way to make all attributes of the child object visible in the view object without committing changes?
    (JDev 9.0.2.822)
    Any help would be appreciated.
    Regards,
    Christian

    Once again the structure, sorry.
    ViewObject
    |-ParentEntityObject
    ..|-PId
    ..|-PAttribute
    ..|-CId (FK)
    |-ParentChildAssociation
    |-ChildEntityObject
    ..|-CId
    ..|-CAttribute
    Christian

  • How to create View Object with Multiple Updatable Entity Objects

    I want both the entities in the view object to support creating new rows but when i give create insert it allows to insert only on the parent and not the child. I found this link
    http://docs.oracle.com/cd/E21043_01/web.1111/b31974/bcadvvo.htm#CEGCAJCI which overrides the exiting classes. but i would like to do it declarative . Is there any other way to do it?
    I am using Jdeveloper 11g version 2.
    Thanks in advance,
    Rakesh

    But when i tried to add a new row it showed this error
    oracle.jbo.AttrValException: JBO-27014: Attribute LookupTypeId1 in FoundationModuleAM.VikLookupTypeBaseVO is required.
         at oracle.jbo.server.JboMandatoryAttributesValidator.validate(JboMandatoryAttributesValidator.java:224)
         at oracle.jbo.server.EntityDefImpl.validate(EntityDefImpl.java:3095)
         at oracle.jbo.server.EntityCache.validate(EntityCache.java:3599)
         at oracle.jbo.server.EntityImpl.validateEntity(EntityImpl.java:2285)
         at oracle.jbo.server.EntityImpl.validate(EntityImpl.java:2464)
         at oracle.jbo.server.DBTransactionImpl.validate(DBTransactionImpl.java:4515)
         at oracle.insurance.viking.foundation.model.common.VikingDBTransactionImpl.validate(VikingDBTransactionImpl.java:46)
         at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2008)
         at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2352)
         at oracle.insurance.viking.foundation.model.common.VikingDBTransactionImpl.commit(VikingDBTransactionImpl.java:37)
         at oracle.adf.model.bc4j.DCJboDataControl.commitTransaction(DCJboDataControl.java:1590)
         at oracle.adf.model.binding.DCDataControl.callCommitTransaction(DCDataControl.java:1415)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1428)
         at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2169)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:731)
         at oracle.jbo.uicli.jui.JUActionBinding.actionPerformed(JUActionBinding.java:193)
         at oracle.jbo.uicli.controls.JUNavigationBar.doAction(JUNavigationBar.java:412)
         at oracle.jbo.jbotester.NavigationBar.doAction(NavigationBar.java:112)
         at oracle.jbo.uicli.controls.JUNavigationBar$NavButton.actionPerformed(JUNavigationBar.java:118)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
         at java.awt.Component.processMouseEvent(Component.java:6289)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
         at java.awt.Component.processEvent(Component.java:6054)
         at java.awt.Container.processEvent(Container.java:2041)
         at java.awt.Component.dispatchEventImpl(Component.java:4652)
         at java.awt.Container.dispatchEventImpl(Container.java:2099)
         at java.awt.Component.dispatchEvent(Component.java:4482)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
         at java.awt.Container.dispatchEventImpl(Container.java:2085)
         at java.awt.Window.dispatchEventImpl(Window.java:2478)
         at java.awt.Component.dispatchEvent(Component.java:4482)
         at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
         at java.awt.EventQueue.access$000(EventQueue.java:85)
         at java.awt.EventQueue$1.run(EventQueue.java:603)
         at java.awt.EventQueue$1.run(EventQueue.java:601)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
         at java.awt.EventQueue$2.run(EventQueue.java:617)
         at java.awt.EventQueue$2.run(EventQueue.java:615)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

  • Object with multiple states and slider in folio are rasterized, settings seem correct.

    I am having trouble keeping An object with multiple text states from being rasterized, as well as a slider that is also rastering.
    I have read that you are supposed to set the folio and article up to be .pdf and that the slider should have the vector option chosen.
    I haven't found anything for the multi state object to for these settings.
    What happens is when I output the folio to Adobe Content Viewer, only the text in those items is rasterized. All other text is crisp. Tested on both iPad Mini and iPad Retina and the both are blurry.
    Is there a way to force the vector option? It seems even with the correct options selected it is still rastering the test in interactive elements.
    Thanks!

    Here is the MSO with the folio.
    Here is the Slider with folio overlays panel.

  • Inserting a new row in a BC4J View Object with an attribute of type BFileDomain

    Hi all,
    I've to insert a row in a View Object with an attribute of type oracle.jbo.domain.BFileDomain.
    I do this within an Application Module's method, which has an input parameter of type byte[]. This parameter will be the content of the BFILE.
    What's the right way for doing that?
    I've tried with the following code, but I've got an exception in committing the transaction:
    public int serializeDocument(int codDomanda, int codSorgente, byte[] content, String est, int type, int cost, String title, String arg) throws JboException {
    int code = 0;
    //File f;
    DocumentiTwoView = getDocumentiTwoView();
    java.sql.Statement stmt = ((DBTransaction) getTransaction()).createStatement(1);
    try {
    Row docRow = DocumentiTwoView.createRow();
    SequenceImpl seq = new SequenceImpl("documenti_seq", getDBTransaction());
    Integer next = (Integer) seq.getData();
    code = next.intValue();
    docRow.setAttribute("Coddocumento", new Number(code));
    docRow.setAttribute("Titolo", (String) title);
    docRow.setAttribute("Argomento", (String) arg);
    docRow.setAttribute("Costo", new Number(cost));
    docRow.setAttribute("Tipo", new Number(type));
    docRow.setAttribute("Coddomanda", new Number(codDomanda));
    docRow.setAttribute("Codsorgente", new Number(codSorgente));
    //f = new File("Doc" + code + "." + est)
    BFILE src_lob = null;
    ResultSet rset = null;
    rset = stmt.executeQuery ("SELECT BFILENAME('DOC_DIR', 'Doc" + code + "." + est + "') FROM DUAL");
    if (rset.next()) {
    src_lob = ((OracleResultSet)rset).getBFILE(1);
    BFileDomain bfd = new BFileDomain(src_lob);
    bfd.setBytes(content);
    bfd.saveToDatabase(getTransaction());
    docRow.setAttribute("Contenuto", (BFileDomain) bfd);
    catch (Exception ex) {
    getTransaction().rollback();
    throw new oracle.jbo.JboException("Impossibile creare il nuovo documento:\n" + ex.getMessage());
    finally {
    try {
    stmt.close();
    catch (Exception nex) {
    try {
    // Commit the whole transaction
    getTransaction().commit();
    catch (Exception e) {
    e.printStackTrace();
    getTransaction().rollback();
    throw new JboException("Impossibile eseguire il commit della transazione:\n" + e.getMessage());
    return code;
    Thanks a lot in advance!
    Christian
    null

    Odd, have you disabled caching and indirection? (NoIdentityMap, dontUseIndirection, or alwaysRefresh/disableCacheHits). If so, then this could be the issue.
    Otherwise please include the sample code you use to perform this, and verify that you do not have any unusual code in your set/get methods or in descriptor events. Also turn TopLink logging on and include a sample. Also ensure that you do not modify your objects until after registering them in the unit of work, and only modify the unit of work clones.

  • View Object with User Defined Type input

    I am trying to use a View Object with a query that requires a user defined object as an input parameter.
    I have the query working with a PreparedStatement, but would like to use a View Object.
    When I use the PreparedStatement, I prepare the user defined type data like this:
    // get the data into an object array
    Object[] wSRecObjArr = wSRec.getObjectArray();
    // set up rec descriptor
    StructDescriptor WSRecDescriptor = StructDescriptor.createDescriptor("WS_REC",conn);
    // populate the record struct
    STRUCT wSRecStruct = new STRUCT(WSRecDescriptor,conn,wSRecObjArr);
    Then I can use this in the PreparedStatement like this:
    OraclePreparedStatement stat = null;
    ResultSet rs = null;
    stat = (OraclePreparedStatement)conn.prepareStatement("Select test_pkg.test_function(?) FROM DUAL");
    stat.setSTRUCT(1, wSRecStruct);
    rs = stat.executeQuery();
    I would like to do the same process with a View Object instead of the PreparedStatement.
    My question is "How do I create the input objects"?
    I obtain the View Object from the Application Module using findViewObject(). I don't actually have a connection object to pass into the StructDescriptor.createDescriptor method.
    I have tried just using Java Object Arrays (Object[]) to pass the data, but that gave an error:
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation.
    Any help or pointers are greatly appreciated.
    Thank you.
    Edited by: 942120 on May 1, 2013 8:45 AM
    Edited by: 942120 on May 1, 2013 8:46 AM
    Edited by: 942120 on May 1, 2013 9:05 AM
    Edited by: 942120 on May 1, 2013 9:06 AM

    Custom domains are the way to go.
    When I try to pass custom domains that represent my user defined types - it works.
    However, one of the functions requires a table of a user defined type be passed in.
    I tried creating a domain of the table type. It forces me to add a field during creation (in JDEV), so I tried adding a field of type Array of Element of the domain representing the user defined type.
    I populate the table by setting the field I created, but the table is empty in PL/SQL (TEST_TAB.COUNT = 0).
    I also tried passing the oracle.jbo.domain.Array object, but that produced an error:
    java.sql.SQLException: ORA-06553: PLS-306: wrong number or types of arguments in call
    I also tried passing Object[], but that produced an error:
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation.
    How do I properly create, and pass an domain that represents a table of a user defined type?
    When I use a OraclePreparedStatement, I can pass a oracle.sql.ARRAY using stat.setARRAY.
    Thank you for the help you have provided, and any future advice.
    JDEV 10.1.2.3
    JDBC 10.2.0.5
    Edited by: 942120 on May 13, 2013 7:13 AM
    Edited by: 942120 on May 13, 2013 7:16 AM

  • Problem extending standard ViewReceiptsSearchVO view object with logic on get method

    Hi All,
    EBS 12.1.3
    Database 11.2.0.3
    I am trying to extend the 3 VOs related to ViewReceiptsSearch.  I extended a seeded ViewReceiptsSearchVO view object.  I haven't made any changes yet, no columns added, nothing altered.  When I run this substitution, the "Received" column is null.  This column in the view used for the view object only selects NULL and uses the getter method for the attribute to populate the value.  The generated extension getter calls getAttributeInternal and skips the logic in the standard getter and the substituted view object is displaying the null in the screen.  The below discussion explains the problem very well except that the original posted had the issue in 11.5.10.2.  I am having this issue with 12.1.3.
    Problem extending standard view object with logic on get method
    The 3 VOs that I am having the problem are:
    ViewReceiptsSearchVO
    ViewReceiptsSearchReqVO
    ViewReceiptsSearchSupplierVO
    What do I need to do to get the "Received" column populated?  Please let me know any additional information you want to troubleshoot the issue.
    Thanks.

    Hi,
    Can you Please Share Extended ViewReceiptsSearchVO.xml and .jpx File?
    Thanks,
    Dilip

  • View Object with ?-style query parameters - best place to locate code

    I am using a View Object with ?-style parameters, with a JClient applet. The query
    paramters are filled in from user-entered data:
    viewObject.setWhereClauseParams(parms); /* parms is the user data*/
    viewObject.executeQuery();
    Right now the above code is located in the applet. Is it more efficient to code this as a
    method in the ViewObject (or Application Module), then call the method from the Client with
    the supplied parameters?
    I'm still unclear as to how network traffic is affected by running code like this on the client
    as opposed to the server. Maybe someone could point me to a comprehensive dic that covers this.
    Thanks

    I am using a View Object with ?-style parameters, with a JClient applet. The query
    paramters are filled in from user-entered data:
    viewObject.setWhereClauseParams(parms); /* parms is the user data*/
    viewObject.executeQuery();
    Right now the above code is located in the applet. Is it more efficient to code this as a
    method in the ViewObject (or Application Module), then call the method from the Client with
    the supplied parameters?
    I'm still unclear as to how network traffic is affected by running code like this on the client
    as opposed to the server. Maybe someone could point me to a comprehensive dic that covers this.Yes, the above two methods will turn into two network roundtrips.
    You may run your application in Events profiler to get a list of 'roundtrip' calls being made in your app.
    Select Project-Settings->Profiler panel->Events panel.
    Deselect all events, expand BC4J events and select REMOTE_METHOD_CALL event type (1016). Then Profile your app using the event profiler and the profiler will list all the calls that BC4J roundtrip calls. You may use this info to narrow down the roundtrips by batching up operations in an exported method etc.
    Thanks

  • View object with bind variables in subqueries

    Hi,
    i create view object with this query:
    Select /*+ use_nl(p p2) */
    'F' tipo_persona,
    p.ID_PERSONA, p.TDOC, p.NDOC, p.DENO
    From SINT_PERSONA p,
    ( Select /*+ index(a SINT_PERSONA_IX2) */
    a.ID_PERSONA
    From SINT_PERSONA_DOCUMENTO a
    where ( NDOC = :p_cuit
    and :p_cuit is not null )
    ) p2
    Where p.id_persona = p2.id_persona
    AND (deno = upper(:p_deno) or
    :p_deno is null)
    AND (NDOC = :p_ndoc or
    :p_ndoc is null)
    and grado_confiab > 0
    My binding style is oracle named.
    Then I add the bind variables:
    p_cuit this is the only required
    p_ndoc
    p_deno
    but when i run the app module with p_cuit = 20123456780 i get this error:
    (oracle.jbo.SQLStmtException) JBO-27122: Error SQL durante la preparación de la sentencia. Sentencia: Select /*+ use_nl(p p2) */
    'F' tipo_persona,
    p.ID_PERSONA, p.TDOC, p.NDOC, p.DENO
    From SINT_PERSONA p,
    ( Select /*+ index(a SINT_PERSONA_IX2) */
    a.ID_PERSONA
    From SINT_PERSONA_DOCUMENTO a
    where ( NDOC = :p_cuit
    and :p_cuit is not null )
    ) p2
    Where p.id_persona = p2.id_persona
    AND (deno = upper(:p_deno) or
    :p_deno is null)
    AND (NDOC = :p_ndoc or
    :p_ndoc is null)
    and grado_confiab > 0
    ----- Nivel 1: Detalle 0 -----
    (java.sql.SQLException) Falta el parámetro IN o OUT en el índice:: 3
    How can i do this ?
    thanks.

    Thanks! that's right the bind variables when i use it on where clause must be required, so i change my sql to:
    Select /*+ use_nl(p p2) */
    'F' tipo_persona,
    p.ID_PERSONA, p.TDOC, p.NDOC, p.DENO
    From SINT_PERSONA p,
    ( Select /*+ index(a SINT_PERSONA_IX2) */
    a.ID_PERSONA
    From SINT_PERSONA_DOCUMENTO a
    where ( NDOC = :p_cuit
    and :p_cuit <> 0 )
    ) p2
    Where p.id_persona = p2.id_persona
    AND (deno = decode(:p_deno,'null',null,upper(:p_deno)) or
    :p_deno = 'null')
    AND (NDOC = decode(:p_ndoc,0,null,:p_ndoc) or
    :p_ndoc = 0)
    and grado_confiab > 0
    and my bind variables:
    p_ndoc required default value 0
    p_cuit required default value 0
    p_deno required default value null
    and works ok!
    thanks a lot !!!!

  • Sharing same entity object with multiple viewobject problem.

    Dear All,
    I have a common entity entity object, that i am using in 4 different vo(only the where clause is different),
    I have created 4 af:table from corrosponding vos, when i am inserting some records in any of the vo then all the vo is showing the same records.. even through each vo is having separate where clause,
    But when i do this with separate eo for each vo then it works fine..
    Here i just want to do with the single eo being shared by different vo of same kind.. except where clause, Also i want to know why this issue is comming on insert? is it normal expected behaviour ? If yes then how to overcome this problem..? Pls provide any good suggestions if you have..
    Thanks & Regards.
    Santosh.

    Hi Sacha,
    Thanks.. i read it and found following
    You can globally disable this feature by setting the jbo.viewlink.consistent to the value false in your configuration. Conversely, you could globally enable this >feature by setting jbo.viewlink.consistent to the value true, but Oracle does not recommend doing this. Doing so would force view link consistency to be set >on for view objects with secondary entity usages that are not marked as a reference which presently do not support the view link consistency feature well.Now i am thinking to set it false.. but as doc says but Oracle does not recommend doing this. Doing so would force view link consistency to be set on for view objects with secondary entity usages that are not marked as a reference which presently do not support the view link consistency feature well,
    With what option should i go...?
    go with separate eo and vo..?
    Regards,
    Santosh.

  • Creating View Object with different criteria

    Hi,
    I have a requirement to execute the following queries in the application logic. We have YEAR table with mileage rates with different effective dates. If the service date is greater than any of the existing effective dates we need to get the rate with that effective date. if the service date is less than the existing effective dates, then we have to get the rate with least effective date.
    SELECT mileage_rate, ... FROM year
    WHERE eff_date =  (SELECT MAX(eff_date) FROM   year WHERE  eff_date <= :bServiceDate)
    SELECT MILEAGE_RATE, .... FROM YEAR WHERE
    EFF_DATE =  (SELECT MIN(EFF_DATE) FROM YEAR)
    We have to execute the 1st query and if there is no matching records then we have to take the second query with min effective date. At present we are creating two view objects for the above scenario. Is there any possibility to create one view object with different criteria. What is the best solution to handle the above problem in ADF.
    Thanks and Regards,
    S R Prasad

    Well on the ViewObjectImpl you can fire the method getQueryHitCount() passing in the required ViewRowSetImpl. If you get the query hit count as 0, use can attached the other query and execute it.

Maybe you are looking for