Many-to-Many in ADF

Hello:
Thanks for looking this post. I have a rookie question, but I'm not finding alot of info regarding this.
Say I have two tables: Teachers and Students and there is a many-to-many between Teachers and Students. So we create a third table called Classes and create two one-to-many relationships.
The Question is how do we do this in ADF? On the screen, I'd like to show Teachers, Students and Classes and have their navigation all coordinated. I would also like to create the association if I insert a new teacher or student. (The association would be an insert into the intersection table Classes for the primary key of teachers and primary key of students) What is the best way to accomplish all of this in the GUI? Got any ideas? Also can you point me to the correct location in the technical docs?
Thanks for the Help.
Don

this will help http://mjabr.wordpress.com/2011/05/21/how-to-implement-many-to-many-association/

Similar Messages

  • ADF-Newbie.How can I create a many-to-many row from an action method?

    Hi all,
    First of all, this is my scenario:
    - JDeveloper 10.1.3.0.4
    - My application is running ADF + Faces + Toplink + EJB Facade
    - My database model includes some many-to-many relationships and some one-to-may relationships.
    I have developed several ADF pages displaying some CRUD operations over my master tables and my master-detail tables without any problem.
    I am now trying to implement some CRUDs over my many-to-many relationship tables.
    Lets call the tables involved as master1, master2, and relationship (the many-to-many table)
    Because usability reasons, my user wants me to implement an interface where he can:
    -Select a row from the master1 table
    -Select a row from the master2 table
    -Click a button called "Create relationship"
    I need to implement the code inside the action button to add my new record on the relationship table, and honestly, I have not found any clue.
    Please, give me some directions to solve my problem.
    Thank you in advance for your help...

    The key here is to work with the intersection table for your MtM relationship.
    The way I do it, is to have the user view Master Table I, and click on the add Relationship button, this button is a link to a add form for the Intersection Table. On the Add form, the MasterTable 1 Id is already filled in and I hide it. I then setup MasterTable 2 as an LOV on the page. The used selects the item from the LOV and clicks on the commit button. I refresh my many-to-many view and all is grand.
    Using ADF/JSF, I have made it even nicer by turning the add relationship page into a dialog page, that way the user can see the previous page while adding the new relationship.
    Kelly

  • Many-to-Many relation sample in ADF

    I have a requirement to implement a screen
    Three tables 1) Users 2) Access 3) Documents
    The Access table contains both the references DocId and UserId and acts as the intersection table.
    Users table is related to Documents through the Access table which acts as the intersection table and vice versa. I need to create a screen gui which will show all the documents a user has. Secondly also show all the users who has permission to a particular document. Is there any sample adf application which implements a simple many-to-many relation.
    I am planning to create three entity objects - UsersEO, AccessEO, DocumentsEO
    two view objects - UsersVO and DocumentsVO
    one view link -UsersDocumentVL
    Also which GUI components is best suited to address this. How many Entity Objects, View Objects and View Link should I create. Any simple sampe will help.
    Regards
    Thomas

    Thomas,
    There are of course many ways to implement your requirement. Try this exercise... forget about ADF for a moment; put your computer away (well, finish reading this first ;) ). Grab a pencil and paper.. assuming you could do anything, how would you like the screen to work? Draw it out on a piece of paper and describe how it works. You've just created a rudimentary specification. Now, come back to this thread and describe your specification - perhaps then we can help you implement your spec using ADF (or at least tell you "not possible" and describe why).
    Best,
    John

  • [ADF] Adding/deleting entries in a many-to-many relationship

    I am using JDeveloper 10.1.3 and the ADF BC / ADF Model / ADF Faces / JSF technology stack.
    For this question, I am using the SRDemo application as an example, specifically the many-to-many relationship between USERS and PRODUCTS (the Staff Expertise relationship), outlined in red in this schema diagram: Image Link
    Users may have any number of product expertise areas and many users may have the same product expertise area. For the purposes of this example I have added two reference fields from the PRODUCT table into the ExpertiseAreas VO (Name and Description), outlined in red in this data control palette section: Image Link
    I have created a page which shows the details of a user (1), along with a table showing the expertise areas the user has (3), and a table of all the products available (2), numbered on this design page: Image Link and corresponding to the numbered data controls on this data control palette section: Image Link, where 1 is rendered as an ADF Read-only Form, 2 is an ADF Read-only Table with a tableSelectMany element in the selection facet, and 3 is also an ADF Read-only Table.
    What I am trying to do is have the tableSelectMany element reflect which of the products are linked to the current user in the expertise areas relationship (by having the checkbox for currently linked products checked), and when you check or uncheck a product's checkbox, it should add or remove the row in the EXPERTISE_AREAS intersection table, respectively (asume for this example that there are default values for Expertise Level and Notes).
    So far I have been following the process used in section 19.8 of the ADF Developer's Guide for Forms/4GL Developers, which describes how to set up a selectManyShuttle which implements the adding and deleting functionality. So I have a Client Interface method in the Application Module, updateSkillsForCurrentStaff (described in section 10.6.7.2), and I have a selection listener for the assignment table in the backing bean for the page, which calls the updateSkillsForCurrentStaff method:
    public void selectionChanged(SelectionEvent event)
      BindingContainer bc = getBindings();
      DCIteratorBinding productsIB = (DCIteratorBinding)bc.get("ProductListIterator");
      Set keys = getTable1().getSelectionState().getKeySet();
      Iterator iter = keys.iterator();
      List productIds = new Vector();
      while (iter.hasNext())
        String product = ((Key)iter.next()).toStringFormat(true);
        productsIB.setCurrentRowWithKey(product);
        ViewRowImpl productRow = (ViewRowImpl)productsIB.getCurrentRow();
        Number productId = (Number)productRow.getAttribute("Id");
        productIds.add(productId);
      OperationBinding ob = bc.getOperationBinding("updateSkillsForCurrentStaff");
      Map pm = ob.getParamsMap();
      pm.put("productIds", productIds);
      ob.execute();
    All of this works, but I can't work out how to link the selection state of the assignment table to the expertise areas that are linked to the user. Also I think the method listing above must be a bit of a hack, but I don't know enough about this to know if there's an easier way of doing it.
    Any help is appreciated.

    Have a look at this example I cooked up for you.
    http://radio.weblogs.com/0118231/2006/10/03.html#a739
    It might not be the first way one thinks to implement something, but it illustrates a very interesting, model-centric approach to the problem you propose.
    My feelings won't be hurt if you prefer a more view-centric approach, but I wanted to illustrate what was a maximally-model-centric solution (in fact, which doesn't even require a backing bean!) If you like a more view-centric approach, I can help you figure out what's wrong with your key-handling above. For one, I would probably start by passing the Set of Key's directly to the middle tier application module method to eliminate client-side code.
    Check it out and let me know what you think. Try it directly in the Business Components Tester to appreciate one of the benefits a model-centric solution can bring.

  • ADF BC: Many-to-Many Insert

    Hi :)
    I have a many-to-many relationship ( person has many cars and cars can have many persons)
    Now i wanted to insert a new car for a given person.
    So i dragged my personview->carView form and readonly table.
    It inserts the new car. But the middle table is not changed.
    Why?

    At row creation time, a view link handles the job of filling in the current value of the respsective foreign key attributes from the current row of the master view. If you have multiple master view objects using multiple view links, then each of them will populate their respective foreign key values. If this is not what you want, then the alternative I suggested that does not use mutlple-master view objects instances would be the way to go.
    I think the simplest thing for you to do is the following:
    (1) Person entity associated to PersonCar entity (1-*)
    (2) Car entity associated to PersonCar entity (1-*)
    (3) Create a PersonView based on Person entity
    (4) Create a PersonCarView based on PersonCar intersection entity, using a secondary Car entity as a reference to display the name of the car
    (5) Create a CarLookupView based on the Car entity (this will be used to present a list of valid cars to pick when adding a new car for a person
    If your PersonEditPage needs to display the current list of cars assigned to that person, then it would show the details from the CarView.
    To add a new car for a person, you create a new row in the CarView that is the detail of the current row in the PersonView.
    The "add a new car for a person" page, would have a dropdown list based on the results of the "CarLookupView" as its valid choices (and it's personId would be filled in automatically from the view link.
    I think this would be the simplest way to address your use case. In practice, rather than using a many-to-many view link, its using just a single view link from PersonView to PersonCarView, and the PersonCarView references the related information about the car using a reference entity usage (which translates to a join in the automatically created SQL for your view object with reference information).

  • SQL-Only Many-to-Many View Links?

    Hi,
    ADF, BC4J, Jdeveloper 10.1.3
    I am working on a reporting system that contains a number of reports on tables that are linked with many-to-many relationships.
    So for example, I have a COMPANIES table that is linked through an intermediate table to a CENTRES table. COMPANIES is also linked in a similar way to VOLUNTEERS. All these links are many-to-many.
    From the companies report page, one can see the centres associated with that company, and vice versa. I would like these to be displayed as clickable links that take the user through to the report page for that table...
    What is the best way to do this?
    Because I am only reporting on these tables (no updates), I have created SQL-only view objects. I thought that View Links might be a good way of listing the associated rows and setting the appropriate row for the reports page when the user clicks a link, but I cant see a way of implementing a view link on a many-to-many relationship between sql-only views.
    Is this possible? Or am I approaching this in the wrong way?
    Any help greatly appreciated,
    Alex.

    Hi,
    ADF, BC4J, Jdeveloper 10.1.3
    I am working on a reporting system that contains a number of reports on tables that are linked with many-to-many relationships.
    So for example, I have a COMPANIES table that is linked through an intermediate table to a CENTRES table. COMPANIES is also linked in a similar way to VOLUNTEERS. All these links are many-to-many.
    From the companies report page, one can see the centres associated with that company, and vice versa. I would like these to be displayed as clickable links that take the user through to the report page for that table...
    What is the best way to do this?
    Because I am only reporting on these tables (no updates), I have created SQL-only view objects. I thought that View Links might be a good way of listing the associated rows and setting the appropriate row for the reports page when the user clicks a link, but I cant see a way of implementing a view link on a many-to-many relationship between sql-only views.
    Is this possible? Or am I approaching this in the wrong way?
    Any help greatly appreciated,
    Alex.

  • Delete entity that participate in many to many association

    Hi all,
    I have two tables related by a many to many relationship (for ex department and employee).
    So I have three tables:
    Department: table of departments
    Employee: table employees
    deptEmp: the association table relating the employees to the departments.
    When a department is deleted, all the corresponding rows in deptEmp table should also be deleted (and same for employee).
    On the entity level, I have created the many to many association (between department and employee) and a one to many association for each of department and employee entities to deptEmp entity (deptEmptAssoc from department to deptEmp and empDeptAssoc employee  to deptEmp).
    I configured the deptEmptAssoc association to be a composition and implement the cascading delete, and it is working fine. When I delete a department, the corresponding rows in deptEmp are deleted.
    The problem is that when I try to do the same for empDeptAssoc, JDev gives me a warning and doesn’t apply the composition neither the cascading delete.
    I tried to override the remove method of employee entity to also remove the corresponding deptEmp but it also didn’t work.
    So any hint or pointer how to achieve this? How to have a many to many association and be able to delete both sides of the association?
    Thank you.

    Hi,
    This behavior can be done by overriding the postChanges method as follow:
      public void postChanges(TransactionEvent transactionEvent) {
            if(getPostState() == STATUS_DELETED){
                RowIterator mmIterator = getMM();
                while (mmIterator.hasNext()){
                    EntityImpl row = (EntityImpl)mmIterator.next();
                    row.remove();
    row.postChanges(transactionEvent);
            super.postChanges(transactionEvent);
    N.B.1  In the xml file of the viewLink, the composition association (and implement cascade delete) should not be checked.
    N.B.2  with these flags unchecked, ADF will not control the posting of entities in case the department and the deptEmp entities were both newly created. To fix the issue, the deptEmp entity should also override the postChanges method as follow:
                        public void postChanges(TransactionEvent transactionEvent) {
            if (getPostState() == STATUS_NEW ||
                  getPostState() == STATUS_MODIFIED) {
                EntityImpl dept = getDept();
                if (dept != null) {
                  if (dept.getPostState() == STATUS_NEW) {
    dept.postChanges(transactionEvent);
                                                    // do the same for the Employee entity if needed
            super.postChanges(transactionEvent);
    Regards.

  • Filtered many-to-many Assoc/Link?

    Hi,
    quite new to ADF (UIX) but already in serious trouble ;-)
    I have 3 Entity Objects: Items, Audiovisuals and Images which map to 3 (different!) Tables. Strictly speaking Audiovisuals and Images are SubTypes of generell Items. But I decided not to implement the super-class-sub-class on entity level but on view level instead.
    (Items only contains primary keys)
    Based on those 3 entites are 3 view objects. Here AudiovisualsView and ImagesView inherit form ItemsView.
    For Items/ItemsView exists a many-to-many Assoc/Link to an Entity/View called Categories/CategoriesView.
    The Assoc is based on an intersection table.
    This intersection contains besides the two foreign keys another column with some number from a lookup, say 1, 2 and 3.
    Q1: how can I retrieve all Categories for an Item having e.g. 2 as number in the intersection? (just like filtering the retrieved Categories to some special attribute in the intersection)
    Q2: where do I have to place the code for this filtering? At the entity level or view level or ItemViewRowImpl?
    I supposes the signature must be something like "RowIterator getCategoriesView(int intersectionAttr)"
    Q3: at the level of UIX, how can I pass the parameter to getCategoriesView?
    Thanks in advance for any help, Christian
    p.s. my data control palette only shows methods exposed at the view level but does not show methods at the view row level. How can I bind methods exposed in the client row interface to my uix page?

    any hints?
    thanks, Christian

  • Complex many to many relationships

    I am new to Oracle ADF and i have a question about associations.
    I have 3 business objects: User, Position and Country. A User can have different Positions for each Country. Therefore, i decided to create another BO, named UserPosition which has 4 attributes: Id, UserId, PositionId and CountryId.
    I wonder which is the best way to define associations for these objects.
    Should i define three "1 to *" associations between each BO's and UserPosition?
    Thanks.

    Usually if you have two tables with many-to-many relationship, you would have third table and its PK should be made of from 1st and 2nd tables. I think you are right. You need the 4th one with a new PK.

  • Adding/removing many-to-many associations with intersection tables

    Hello,
    I am using Jdeveloper 11g with ADFBC.
    I have some many to many associations in my application. For example User and Category are associated and there is an intersection entity (UserCategory - Columns are UserId, CategoryId) to save these associations.
    What is the correct method for adding or removing categories assigned to user?
    Thanks.
    Edited by: Deniz Gulmez on 01-Nov-2009 03:25

    I found an example for Jdeveloper 10g, which is discussed [ADF] Adding/deleting entries in a many-to-many relationship
    In that example, many-to-many association is defined as two 1-to-many associations. Actually i've been searching since last week for an example which is made with many-to-many associations but no help. I will change my Model structure if it is not an efficient way to define many-to-many associations with intersection tables.
    I wonder if it is possible to write some methods like :
    addCategoryToUser(String userId, String categoryId)
    removeCategoryToUser(String userId, String categoryId)
    addCategories(String userId, List categoryIds)
    vs.
    Of course i am able to do these by creating a new Row in UserCategoryView (Intersection view), setting it's attributes and saving. Or the opposite, finding the row in intersection table and deleting it.
    For example:
    public void removeCategoryFromUser(String userId, String categoryId){
    ViewObjectImpl vo = this.getUserCategories1();
    vo.setWhereClause("USER_ID = :userId AND CATEGORY_ID = :categoryId");
    vo.defineNamedWhereClauseParam("userId", null, null);
    vo.defineNamedWhereClauseParam("categoryId", null, null);
    vo.setNamedWhereClauseParam("userId", userId);
    vo.setNamedWhereClauseParam("categoryId", categoryId);
    vo.executeQuery();
    Row row = vo.first();
    row.remove();
    I wonder if there is a more efficient way. Any samples would be appreciated.
    Edited by: Deniz Gulmez on 01-Nov-2009 05:49

  • SQLIntegrityConstraintViolationException in a "many to many" related tables

    Hi, in an 11g adf application I have a “many to many” relationship between two tables A and B and an intermediate table C that relates them.
    The database has constraints that check for id existence in master tables before saving rows in C.
    When I’m trying to create a new entry in B’s UI form with relations to A I’m getting a:
    java.sql.SQLIntegrityConstraintViolationException: ORA-02291:
    the framework seems that tries to save the row in C before B. So there doesn’t exist the id in B.
    The same operation in A table’s UI form is executed properly. The framework first creates a row in A
    and then related it with B creating rows in C and no constraint violation is thrown.
    Why is this happening?
    Any comment will be helpful.
    Thanks

    Using BC Tester the save operation is executed properly without errors.
    The constraint you are asking is a classic referential constraint in intermediate table C that requires when creating new rows in C the foreign key refer to B to pre-exist in B table.
    So the sequence of save operation is important when creating new rows in B and C table.
    If I create a new row in B, save it and then create relations as new rows in C everything is fine.
    But if I concurrently create a new row in B with rows in C, the framework seems that tries to save firstly the rows in C and then in master table B so the referential integrity is violated.
    Is it possible in ADF to influence to order of saves in master detail tables and how is this specified?
    For example the same operation with same integrity constraints in UI form of A table is executed properly.

  • One to Many And Many to Many Association(jdev 11.4 ps3)

    Hi All,
    I was trying different types of ADF-BC implementations, I am stuck with following
    1)     One to Many Association
    a.     Order – OrderItem ( Join over two tables, One OrderVO should have List<OrderItemVO> orderItems
    b.     Employee-Manager (Self Join on the Employee Table, One Employee should have List<Employee> subordinates [0 to *])
    c.     Manager-Employee (Self Join on the Employee Table, One Employee should have List<Employee> managers [ 0 or 1] )
    2)     Many to Many Association
    Would be very helpful if you could provide any Blog published or Some sample implementation of the above.

    Would be very helpful if you tell us which version of jdev you are looking at.
    All this is described in the docs http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/bcintro.htm#sm0051 to start with and http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/bcentities.htm#sm0124 to follow up.
    Timo

  • Many to Many set up

    Hey guys long time no hear :)
    I have a conceptual problem (Using Jdeveloper 11g, with ADF Business Components) that I was hoping you could advise me with. I have 3 tables. Tech_Equipment, Terminal_Type, and Equipment_Terminal. As you may have already guessed they are in a many to many relationship with Equipment_Terminal serving as the intersection table. I have now just started doing the CRUD forms for all my tables and have left this for last.
    What I wanted to do was create an af form to somehow do this but I am not sure how. I want the user to be able to add a Tech_Equipment, and Terminal_Type and for the Equipment_Terminal to automatically take from those 2 tables.
    I was thinking of creating a 2 forms one for adding Tech_Equipment, one for Adding_Terminals, and a third for the Equipment_Terminal table, where the primary key would be auto generated and read only from a sequence, and 2 LOVs (choice lists) which would be based on primary keys from the other 2 tables (therefore enabling to user to only choose already existing Tech_Equipment, and Type_Terminal).
    The problem I see is that Tech_Equipment has a foreign key Terminal_Type_ID which I made an LOV based on Terminal_Type name. So whenever you want to insert a Tech_Equipment you have to choose the Terminal_Type. This creates a problem when you have more than one Type_of_Terminal, and I want to show it to the user, as the choice list will only let me choose the one.
    Any help and advice are appreciated

    Have you checked this sample:
    http://blogs.oracle.com/smuenchadf/examples/#89
    Regards,
    DEMR

  • Hibernate - Spring - problem with mapping (many-to-many)

    Hello,
    I want to map the following situation. I have a table called EDUCATION and a table called SCHOOLS. Between those tables I have an associative table called EDUCATION_SCHOOLS. The (usefull) fields:
    EDUCATION:
    id (long) - PK
    name (varchar)
    versionNr (long)
    SCHOOLS:
    id (long) - PK
    name (varchar)
    versionNr (long)
    EDUCATION_SCHOOLS:
    id (long) - PK
    education_id (long) (FK to EDUCATION.id)
    school_id (long) (FK to SCHOOLS.id)
    name (varchar)
    versionNr (long)
    Their is a Unique Constraint between EDUCATION_SCHOOLS.education_id and EDUCATION_SCHOOLS.school_id.
    What I want to be able to do:
    EDUCATION: select, update, insert
    SCHOOLS: select, update, insert
    EDUCATION_SCHOOLS: select, update (only the non-FK fields), insert
    I never want to delete anything in those tables. (and it's never ever going to be an option either)
    Hibernate version:
    Hibernate-Version: 3.0.5
    Mapping documents:
    Education:
    <hibernate-mapping>
         <class name="##.Education" table="EDUCATION">
              <id name="id" column="ID" type="java.lang.Long">
                   <generator class="sequence">
                        <param name="sequence">EDUCATION_SEQ</param>
                   </generator>
              </id>
              <version name="versionNr" column="VERSIONNR" type="long"/>
              <property name="name" column="NAME" type="string" />
            <set name="SCHOOLS" table="EDUCATION_SCHOOLS">
                <key column="EDUCATION_ID" />
                <many-to-many class="##.Schools" column="SCHOOL_ID" lazy="false" />
            </set>
    </hibernate-mapping>
    Schools:
    <hibernate-mapping>
         <class name="##.Schools" table="SCHOOLS">
              <id name="id" column="ID" type="java.lang.Long">
                   <generator class="sequence">
                        <param name="sequence">SCHOOLS_SEQ</param>
                   </generator>
              </id>
              <version name="versionNr" column="VERSIONNR" type="long"/>
              <property name="name" column="NAAM_NAME" type="string" />
            <set name="educations" table="EDUCATION_SCHOOLS" inverse="true" cascade="none">
                <key column="SCHOOL_ID" />
                <many-to-many class="##.Schools" column="SCHOOL_ID" lazy="proxy"/>
            </set>
    </hibernate-mapping>
    Education_schools:
    <hibernate-mapping>
    <class name="##.EducationSchools" table="EDUCATION_SCHOOLS">
               <id name="id" column="ID" type="java.lang.Long" unsaved-value="0">
                   <generator class="sequence">
                        <param name="sequence">SEQ_EDUCATION_SCHOOLS</param>
                   </generator>
              </id>
              <version name="versionNr" column="VERSIONNR" type="long" />
              <many-to-one name="education" class="##.Education" cascade="none" lazy="proxy"
                           column="EDUCATION_ID" not-null="true"/>
            <many-to-one name="schools" class="##.Schools" cascade="none" lazy="proxy"
                        column="SCHOOL_ID" not-null="true"/>  
    </hibernate-mapping>   
    Name and version of the database you are using:
    Oracle XE 10g
    I am able to:
    EDUCATION: select, insert, update
    SCHOOLS: select, insert, update
    EDUCATION_SCHOOLS: select
    Problems:
    EDUCATION_SCHOOLS: when I try to insert, I sometimes get unique constraint violations. (when I should get them, thus I'm trying to insert something that already exists .. but how do I stop Hibernate from Inserting?)
    EDUCATION_SCHOOLS: when I try to update, sometimes it works, but often I get:
    23:03:55,484 [http-8081-1] ERROR be.vlaanderen.lne.vea.epb.ui.struts.EpbExceptionHandler - org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Object of class [##.EducationSchools] with identifier [null]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [##.EducationSchools#<null>]
    ex.getMessage() Object of class [##.EducationSchools] with identifier [null]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [##.EducationSchools#<null>]
    org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Object of class [##.EducationSchools] with identifier [null]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [##.EducationSchools#<null>]
    Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect):As you can see from the stacktrace I use Spring for the transactionManager: org.springframework.orm.hibernate3.HibernateTransactionManager in which I use e sessionFactory: org.springframework.orm.hibernate3.LocalSessionFactoryBean
    In my DAO, I try to save with the regular this.getHibernateTemplate().saveOrUpdate that has always worked for me.
    Another problem I have:
    when i update "name" in EDUCATION, the records with that ID are delete from EDUCATION_SCHOOLS ...
    As I am experiencing 3 different problems, I'm pretty sure something is wrong in the mapping files .. however I fail to find out what .. Any input would be greatly appreciated.
    (I translated some class/table-names, that's what the ## cause)
    Edited by: Bart_Blommaerts on Jul 29, 2008 11:53 PM

    Thank you for your input.
    When I try what you suggest, I still get the same error:
    16:39:30,406 [http-8081-1] ERROR ###.EpbExceptionHandler - org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Object of class [###.EducationSchools] with identifier [2]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [###.EducationSchools#2]
    ex.getMessage() Object of class [###.EducationSchools] with identifier [2]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [###.EducationSchools#2]
    org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Object of class [###.EducationSchools] with identifier [2]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [###.EducationSchools#2]
    Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [###.EducationSchools#2]If you had to map the database tables, I'm trying to map, how would you do it?

  • Many-to-many performance issue

    I realize that many-to-many joins have been discussed before (yes, I looked through many threads), but I'm having a slight variation on the issue. Our data warehouse has been functioning for a couple of years now, but we're now experiencing a dramatic degradation in report performance. I'll tell you everything I know and what I've tried. My hope is that someone will have an idea that hasn't occurred to me yet.
    The troubling data links deal with accounts and account_types. Each transaction will have one account, but each account can have multiple account_types and each account_type is made up of multiple accounts. It ends up looking like this:
    Transaction_cube --< account_dimension >--< account_type_table
    Given the many-to-many relationship between account and account_type, this is the only architecture I could come up with that will maintain data integrity in the transaction cube.
    I know that this is the cause of the performance issues because the reports run normally when this is removed. The volume of data obviously increases over time, but the problem appeared very suddenly -- not a gradual degradation that one would expect from a volume issue. The cube is partitioned by year and we're a little below last year's growth.
    The other fact to throw in is that the account_type table did increase in size by an additional 30% when we first noticed the problem. However, the business was able to go back and remove half of the account_types (unused types) so now the table has fewer rows than it had before we noticed the problem (~15k rows in the account_type table).
    We have tried pinning the table so that it remain in memory, but that did not help. I tried creating a materialized view combining accounts and account_types with a similar lack of improvement. I've tried adding indexes, but there is still a full-table scan. All database objects are analyzed nightly after the data load is completed.
    I'm fresh out of ideas at this point. Any suggestions and/or ideas would be greatly appreciated.

    I've thought about that. What it would mean would be aprox. 20 additional columns for each of the different account_types. Unfortunately, that would also mean that all the reports that use the account_type would have to have a condition:
    WHERE acct_type1='Income Stmt." OR acct_type2='Income Stmt." OR ....
    Since the account_types are not set up in a hierarchy and there must be only one row for account, I'm not sure that this is a feasible solution.
    Thank you for the suggestion.

Maybe you are looking for

  • Ftp Adapter getting invoked more than once

    Hello All, I have an FTP polling on a remote server, the options that i chose are archive file after read. The problem is the bpel process is getting invoked more than once. If anyone encountered a similar problem, help is really appreciated. Thanks

  • Regarding Drag N Drop

    I have created an environment where all the defined sources are allowed to drop in.But i'am unable to identify one particular drag source in the drop event. I'am using one Jtable as target for different Jtables. I have not defined source in the targe

  • WRT54GL connect error

    Hi, Cant anyone tell me why I can't connect to my router to make settings? When I plug all cables my laptop dose not assign correct IP (I get this IP address 169.254.54.249)and if I try to ping to 192.168.1.1 I get "Destination Host Unreachable" or s

  • Displaying the checkbox created at runtime

    hai all, i have created the checkboxes at runtime but they are getting displayed in the same line. i need to display them one after the other in next lines.please help me its urgent. Thanks n Regards Sharanya.R

  • HT1941 Hi I am having trouble sync my address book on i cloud

    My addres book is not syncing with my iphon and my ipad When I set up my google mail it does not show address book or contacts at all