Multiple tables of the same entity

Hi *,
I would like to do the following but don't really know how to go about it. Any hints?
Suppose I have an entity A which has a field which is a collection of objects of entity B and entity B has the ID of entity A as a field (for cross reference). Is there a way so that I instead of 1 database table for entity B, I can create database tables of entity B which are separated on the value of the ID of entity A?
I hope this is clearly formulated!
Best regards,
Vaak

I think 2 beats 1. The main reason being to minimise the number of network calls. You're basically asking, are fascades a good idea? and the answer is yes.
You can obviously do 3 in different app servers. However you'll need to configure your app servers so they can handle the fact that they're not the only ones updating the database. This is to handle concurrency as you mentioned. How you do this will depend on your app server and will affect performance, but shouldn't be a problem.
I think you should definately decide up front what's going in different app servers, I dunno if 3 would work in the same app server.
Why do you would want to use multiple app servers?
Why not have everything in the same app?
Is is just the 1 database?
You can use clustering for scalability.

Similar Messages

  • How to insert a UUID into multiple tables in the same form

    I am trying to insert a UUID into 2 different tables at the
    same time ie to let this be created in the form and then insert
    this ID into 2 linked tables in a database using Access.
    Does anybody have any suggestions on how to accomplish this?
    Thanks very much

    So you have one form that processes information for two
    tables, or do you
    have two forms (one for each table - except the UUID)?
    If it is one form just run two SQL insert statements. One for
    the primary
    table, then one for the related table.
    If it is two forms run the above two SQL statements then an
    update statement
    to finish filling the second table.
    Or am I completely misunderstanding the issue?
    Bryan Ashcraft (remove brain to reply)
    Web Application Developer
    Wright Medical Technology, Inc.
    Macromedia Certified Dreamweaver Developer
    Adobe Community Expert (DW) ::
    http://www.adobe.com/communities/experts/
    "weelco" <[email protected]> wrote in
    message
    news:esjtjj$qtc$[email protected]..
    > Thanks for your quick reply, and yes I do know how to do
    that however I
    > would
    > like to do this all in one form field so I would like to
    create the UUID
    > whith
    > the same form that also submits it to another table, is
    this possible or
    > do I
    > have to do that using multiple 'pages'?
    >

  • How do you insert new records into multiple tables using the same unique primary key?

    I’ve created a PHP site and MySQL server using a free app called XAMPP.  I have successfully created a form in Dreamweaver that will write data to a (name) table in the SQL database.  Here’s my question: How do you write to two (or more) tables in the same database and pass the same primary key to both tables?  In the SQL database, I defined the first field as ID and set it as the primary key with auto update.  So, when you insert a new record, it creates a unique primary key for that record.  In my form, I’m capturing info that needs to be stored to two tables at the same time; a Name table and Address table. Since the Name and Address tables use the ID field as the primary key, I believe I will need to pass the ID value from the Name table to the insert of the Address table to insure they both have the same primary key, right?

    No. You probably need the primary key from one table to be a foreign key in the other tables. In any case, I believe you can use two methods to obtain the auto generated key. First with SQL:
    http://dev.mysql.com/doc/refman/5.0/en/getting-unique-id.html
    And the other using a PHP function:
    http://us3.php.net/mysql_insert_id

  • Multiple instances of the same entity bean?

    I am designing a J2EE application that is made up of a number of separate components that each have a well-defined responsibility. Each component is made up of one or more J2EE components (web clients and EJBs). I want to design the application such that it is easy in the future to deploy each component (or a group of components) on different servers. In order to do this I need to make sure that the interfaces between each component are exposed as remote interfaces (but I will use local interfaces inside each component). However, there are a number of entity beans that need to be accessed by more than one component. I am wondering how best to expose these entity beans. I believe there are a number of options:
    1. Expose remote interfaces on each of the shared entity beans. The disadvantage of this approach is that it is inefficient and that I will not be able to take advantage of container managed relationships. (I am intending to use container managed persistence.)
    2. Create a facade object (stateful session bean) for each of the entity beans which exposes a remote interface and in turn accesses the shared entity beans locally. The disadvantage of this approach is that I have to create some extra EJBs and that I cannot directly make use of container managed relationships etc from the client component.
    3. I don't know if this is an option but I am wondering whether I can deploy a copy of each shared entity bean with each application component. The advantage of this approach is that the component would access the entity locally and could make use of container managed relationships. However, I don't know what the issues are with having more than one instance (per primary-key) of an entity in the same application. I don't know whether this would cause errors of whether they would get out of sync (because different instances with the same primary key would be updated by different clients). Initially each component would be deployed in the same server but later they would be deployed in different servers. In both cases with this option each component (JAR) would have copies of the shared entity bean classes.
    Any suggestions as to the best approach and whether the last option is feasible would be much appreciated.
    Thanks.

    I think 2 beats 1. The main reason being to minimise the number of network calls. You're basically asking, are fascades a good idea? and the answer is yes.
    You can obviously do 3 in different app servers. However you'll need to configure your app servers so they can handle the fact that they're not the only ones updating the database. This is to handle concurrency as you mentioned. How you do this will depend on your app server and will affect performance, but shouldn't be a problem.
    I think you should definately decide up front what's going in different app servers, I dunno if 3 would work in the same app server.
    Why do you would want to use multiple app servers?
    Why not have everything in the same app?
    Is is just the 1 database?
    You can use clustering for scalability.

  • How to change the same cell in multiple tables at the same time

    help if you can,
    i have a workbook
    workbook has 10 sheets
    each sheet has 1 table
    when in excel you were able to select a sheet then hold control and select another, this would group the sheet as if to make them the same. change a single cell in one of the sheets and this changed cell would be also be changed in all grouped sheets. is there the same functionality in numbers?

    It's funny.
    This question was asked several times in the last ten days.
    The feature is unavailable.
    _Go to "Provide Numbers Feedback" in the "Numbers" menu_, describe what you wish.
    Then, cross your fingers, and wait _at least_ for iWork'10
    Yvan KOENIG (VALLAURIS, France) jeudi 8 octobre 2009 18:57:14

  • Simultaneously Connecting Multiple Tables of the same Database to Textboxes of the same Form using a single ADO Control Code using VB6 Enterprise Edition and MS Access 2007

    Iv 10 Tables consisting of atleast 10 fields each in a single Database. Bt, Im only able to connect 1 table at a time to a form using an ADO Control. Im able to add data from table 'student' to text-boxes in my form. Bt, hw can I add data from field(0) of
    Table 'Student' to Textbox1 and data from field(0) of Table 'Marks' to Textbox2 using VB6??
    This is the current sample coding iv got to connect a single table to a form:
    Global con As New ADODB.Connection
    Global rs As New ADODB.Recordset
    Public Function Connect()
    If con.State = 1 Then con.Close
    con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\bca.mdb;Persist Security Info=False"
    End Function
    Private Sub Add_Click()
    If rs.State = 1 Then rs.Close
    rs.Open "select * from student", con, adOpenDynamic, adLockOptimistic
    rs.AddNew
    rs.Fields(0) = (Text1.Text)
    rs.Fields(1) = (Text2.Text)
    rs.Fields(2) = (Text13.Text)
    rs.Fields(3) = (Text4.Text)
    rs.Fields(4) = (Text5.Text)
    rs.Fields(5) = (Text6.Text)
    rs.Fields(6) = (Text7.Text)
    rs.Fields(7) = (Text8.Text)
    rs.Fields(8) = (Text9.Text)
    rs.Fields(9) = (Text10.Text)
    rs.Fields(10) = (Text11.Text)
    rs.Update
    MsgBox " Record Added"
    End Sub
    What can I do to add fields from 2 different tables to different text boxes within the same form using a single ado control using vb6 and MS Access 2007??

    Hi,
    Since VB6 product is not supported in this forum, you may go to these forums for support:
    #Where to post your VB 6 questions
    http://social.msdn.microsoft.com/Forums/en-US/6a0719fe-14af-47f7-9f51-a8ea2b9c8d6b/where-to-post-your-vb-6-questions
    Thank you for your understanding.
    Best regards,
    Franklin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Multiple instances of the same entity bean out of sync

    Env: NT4.0SP6/jdk build 1.3.1-b24/oc4j 1.0.2.2.1
    Scenario:
    A) Session Bean(SB) 1 loads Entity Bean (EB) 1.
    B) Another Session Bean, SB2, loads the same EB1 (same pk).
    (It turns out that oc4j loads 2 instances of the same EB1.)
    C) SB1 changes data of EB1, and shows the data. All ok. The data
    is there in database, shows up fine on the screen.
    NOTE: the second instance of EB1 which is referenced by SB2 does
    not receive any ejbLoad/... etc calls at this time.
    D) Now SB2 tries to load the same EB with a different pk(EB2),
    immediately causing oc4j to issue ejbStore to the 2nd instance
    of EB1 (referenced by SB2), making it overwrite the changes made
    by the EB1 referenced by SB1 (step C above).
    I tried exclusive-write-access=false setting in orion-ejb-
    jar.xml,
    and it solved the above problem by making only one instance of
    the EB with the same pk, and making sure ejbLoad/Store was
    called around each biz. method.
    However, I don't see any reason to turn off the exclusive-write-
    access flag, as no one is writing into the database behind
    oc4j's back.
    Does anyone else see this behaviour (which looks like a major
    bug as the container
    must ensure that the instances of the same EB with same PK are
    in sync)?
    Thanks,
    - nik.

    yes, i have a similar problem with the 2.0.0 technology preview.
    i added some kind of 'code' which demonstrates my problem at the
    end of this message.
    Description: It seems that different instances are not
    synchronized correctly. I set a CMPfield and when I call getXY()
    on this CMPfield from within a different instance of this ejb
    (for example use a finder method to return a remote interface
    for the same pk), then this getter of the CMP field returns an
    old and wrong value.
    bad bug, i guess.
    suggestions?
    Greetings from munich, /thomas
    public TestBean
    public abstract void setCMPField( int i );
    public abstract int getCMPField();
    void testMethod()
    //set the cmpfield
    setCMPField( 5 );
    //call getXY() on 'this'
    System.out.println( getCMPField
    () ); //correct value 5 is returned
    //now get a remote reference of 'this' and call getXY()
    there
    TestBeanRemote rem1 = ejbContext.getEJBObject();
    System.out.println( rem.getCMPField
    () ); //correct value 5 is returned
    //now call a finder and call getXY() on the returned
    remote
    TestBeanRemote rem = ejbContext.getEJBHome
    ().findByPrimaryKey( ejbContext.getEJBObject().getPrimaryKey() );
    System.out.println( rem.getCMPField
    () ); //PROBLEM!! OLD VALUE RETUNRED!!!!!!

  • How to see multiple tables on the same screen using Mac Numbers?

    I'm working with a spreadsheet on Numbers (iWork '08) on my Mac. I have three worksheets that each have one table in them. I'd like to be able to see two of the tables simultaneously. Similar to the "Tile" function that I used to use in Microsoft Word. Does anyone know if something like this exists? Googled for it until I was blue in the face and went back at least 500 threads here!!!

    Jon,
    This will seem so easy once you get it. In the Sheets Pane, drag tables from one sheet to another until you have all three in one sheet. Then go to that sheet and arrange the tables to your liking.
    I should note that you will need to make sure that the Sheet icons are expanded: click on the triangle next to the Sheet icon until it points downward and reveals the sheet content.
    Regards,
    Jerry
    Message was edited by: Jerrold Green1

  • Updating a field in multiple tables at the same time

    Hi All,
    I have a table with right and wrong values of a field 'id'. I want to replace the wrong values in all the tables at all_tab_columns with the right values. I did the following and it did not work. Please help.
    CREATE OR REPLACE PROCEDURE Clean_ID_Proc(v_id number) IS
    right_id number;
    v_table_name varchar2(100);
    BEGIN  
        Select correct_id into right_id from tb_id
        where wrong_id = v_id;
        FOR table_cur IN (select * from all_tab_columns
                            where column_name = 'ID')
        LOOP
          EXECUTE IMMEDIATE 'update '||table_cur.table_name||'  set id = '||right_id||' where id ='|| v_id;
        END LOOP;     
    END;The error I have been getting is :
    [1]: ORA-00942: table or view does not exist
    [1]: ORA-06512: at "schema.CLEAN_ID_PROC", line 12
    [1]: ORA-06512: at line 1
    Thanks in advance

    user7415666 wrote:
    Hi All,
    I have a table with right and wrong values of a field 'id'. I want to replace the wrong values in all the tables at all_tab_columns with the right values. I did the following and it did not work. Please help.
    CREATE OR REPLACE PROCEDURE Clean_ID_Proc(v_id number) IS
    right_id number;
    v_table_name varchar2(100);
    BEGIN  
    Select correct_id into right_id from tb_id
    where wrong_id = v_id;
    FOR table_cur IN (select * from all_tab_columns
    where column_name = 'ID')
    LOOP
    EXECUTE IMMEDIATE 'update '||table_cur.table_name||'  set id = '||right_id||' where id ='|| v_id;
    END LOOP;     
    END;The error I have been getting is :
    [1]: ORA-00942: table or view does not exist
    [1]: ORA-06512: at "schema.CLEAN_ID_PROC", line 12
    [1]: ORA-06512: at line 1
    Thanks in advancewhat is the actual table_name of the table being updated?
    who owns this table?
    which USER owns & runs posted code?
    why did you bother populating TB_ID table instead of doing the UPDATE at that time?

  • Multiple DEVL_PROJECT_ID for the same model in CZ_DEVL_PROJECTS Table.

    Hi,
    Did anyone came across this issue!! I am triggering the config engine from back and and trying to pick up a model but it has multiple devl_project_id's. :(
    I could see multiple DEVL_PROJECT_ID for the same model in CZ_DEVL_PROJECTS Table. Apart from DEVL_PROJECT_ID and created_by_date every thing looks the same.
    Below are the 2 records the data from the table
    select * from CZ.CZ_DEVL_PROJECTS where product_key = '122:17056' and DEVL_PROJECT_ID in (12943,15321)
    DEVL_PROJECT_ID     NAME     ORIG_SYS_REF     CREATION_DATE     LAST_UPDATE_DATE     PERSISTENT_PROJECT_ID     MODEL_TYPE
    12943     ASI XXX MODEL(122 17056)     OPTIONAL:122:17056     12/18/2012 10:01     12/18/2012 10:01     11100     A
    PRODUCT_KEY     ORGANIZATION_ID     INVENTORY_ITEM_ID     BOM_CAPTION_RULE_ID     NONBOM_CAPTION_RULE_ID
    122:17056     122     17056     802     801
    15321     ASI XXX MODEL(122 17056)     OPTIONAL:122:17056     12/26/2012 23:10     12/26/2012 23:10     11100     A     
    122:17056     122     17056     802     801
    Thanks in advance,
    -vijay

    It can be possible to have multiple devl_project_id for the same model in cz_devl_projects Table.
    Case -1 : When you delete the existing model and re-import again.
    case 2:
    When you publish the model locally, it will create the same copy of the record with different devl_project_id, creation_date, last update_date etc..\
    You can see that for published records the last_updat_login, checkout_user will be null and for the original model, last_update_login,checkout_user (if model is locked) will not be null.
    -Murali
    Edited by: 907569 on Jan 8, 2013 10:55 AM

  • Can Numbers Display Multiple Views of the Same Table

    Hi,
    Excel and Appleworks both have a pull down tab on the vertical bar allowing multiple views into the same spreadsheet (table). Can Numbers do this?
    I have a set of calculations at the top of a spreadsheet that are based on years and years worth of data under the calculations (same column). I add data for each new event (the rows) and watch the calculations at the top of the data. Easy to do in Excel or Appleworks, but, I can't figure out how to do this in Numbers.
    Example:
    Spot1 Spot2
    Total 15 36
    Avg 5 12
    Jan 09 5 10
    Feb 09 6 20
    Mar 09 4 6
    Apr 09
    So... does Numbers allow the view "split" or multiple views that Excel and Appleworks allow?
    Thanks!
    Tom

    Question asked and responded several times:
    feature unavailable.
    For multiple views of a table there is an easy workaround as we may build a table whose every cells grab their contents from the 'master' one.
    _Go to "Provide Numbers Feedback" in the "Numbers" menu_, describe what you wish.
    Then, cross your fingers, and wait _at least_ for iWork'10
    Yvan KOENIG (VALLAURIS, France) mardi 1 septembre 2009 21:56:42

  • I want to create a mail merge for address labels into a table, but when I fill a table with merge fields, it ends up creating multiple entries for the same address, rather than one table full of each address.

    ...but when I fill a table with merge fields, it ends up creating multiple entries for the same address, rather than one table full of each address. Please help.
    Thanks!

    That is a quirk of Pagesthat  it applies only one record per page.
    There is a way around this:
    http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=245&highlight=labels &mforum=iworktipsntrick
    Peter

  • How can I have use the same div ID multiple times on the same page?

    Okay so a problem I encounter a lot is that often times I want to use the same div ID several times on the same page. An example of this is when I'm creating table like designs.
    Let's say for instance I create a div ID called 'product-container'. I want to use 'product-container' multiple times on the same page but if I do this it is improper XHTML and will throw errors in any XHTML validator (you are only allowed to use a div ID once on any XHTML page in order for it to be standards compliant).
    Now the first option is that I could define 'product-container' in my CSS style sheet multiple times by doing something like this...
    #product-container {
         width: 300px;
    #product-container-2 {
         width: 300px;
    #product-container-3 {
         width: 300px;
    #product-container-4 {
         width: 300px;
    What you will see there however is that it seems pointless to define the same ID numerous times over (just adding a number on the end) when each ID is the exact same thing and has the exact same attributes.
    Now what I have noticed is that there are some sites out there who manage to have the same ID appear several times in the code but add a number to it just like above. The difference is that they only have one definition for 'product-cointainer' in their CSS document but in their actual XHTML code they have IDs for 'product-container' but with numbers on the end like 2,3,4,5, etc. It's almost as if JavaScript or some other code is automatically appending a number on the end of the ID so the validator won't consider the markup to be invalid, but yet it knows that it's using the same 'product-container' style that is contained in the CSS style sheet.
    I hope I explained this correctly. I'm just hoping to find a way that I can put the same div ID on a page multiple times without having to define it over and over again in my CSS.
    Any help is much appreciated!

    Because it seems like by using a class you can't make this position as 
    well as you can by using an ID. Am I wrong?
    An ID name can be used only one time per page.  A class name can be used multiple times per page.
    .product {
    width: 300px;
    text-align:left;
    color: #FF0000
    border: 2px solid #666;
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • Multiple tables with the possibility of multiple records in each table

    Post Author: viper
    CA Forum: .NET
    Hi
    I have been trying for a few days now to come up with a CR solution to displaying data from multiple tables.  These tables, in some cases, have more then one record that needs to be displayed.  This is basically what I am trying to do.....
    I am developing a .net web application(vb) using vs2005 and an oracle 10g backend.  There is a data entry part of the site that users will enter data related to a property.  Other users will be able to search these records and have a list of records returned based on the search criteria.  The user then can click on one of these records to view a pop up CR report containing all the data related to that one property.  The PropID is passed to the pop up page and is used in the WHERE clause of my SQL statement to bring back only one property.  This data can come from as many as 18 tables if all the fields have been entered for this property.  I have tried many different solutions to get the data from multiple tables...and have had some that were close to what I need.  The best one I have will display data from multiple tables but only one record per table.....which doesn't work in my case since some of the tables have more then one record per table.
    Is there anybody that has had success in setting up similar reports?
    Does anybody know how I could use the "Group Expert" to group by the tables in my application?  I can only figure out how to group within a single table.
    It would be great if I could group by table....then just display the record(s) in each table that had the same PropID.  I am not sure if the pdf export would show all the data in that situation but it would be worth a try.  If fact...maybe I could create a new table called MyTables and just add two colums like MyTableID and MyTableName.  Then add all the table names to MyTables that I want to see in the report and add the associated MyTableID value to each table as a new column.  I could then group by MyTableID and PropID.  Just guessing here.
    Any ideas would be appreciated.

    Post Author: quafto
    CA Forum: .NET
    Your query is not too clear so I'll do my best to answer it broadly.
    You mentioned that you have a .NET web application where your users enter data on one screen and then may retrieve it on another. If the data is written in real time to a database then you can create a standard Crystal Report by adding multiple tables. The tables should be linked together using the primary and foreign keys in order to optimize the database query and give you a speedy report. Using unlinked tables is not recommended and requires the report engine to index the tables (it is quite slow).
    You also mentioned you have a "PropID" to be used in a WHERE clause. This is a great place to use a parameter in your report. This parameter can then be used in your record selection formula inside Crystal Reports. The report engine will actually create the WHERE clause for you based on the parameter value. This is helpful because it allows you to simply concentrate on your code rather than keeping track of SQL queries.
    Now, what Crystal does not do well with is uncertainty. When you design a report with X number of tables the report engine expects X number of tables to be available at processing time. You should not surprise the print engine with more or less tables because you could end up with processing errors or incorrect data. You may need to design multiple reports for specific circumstances.
    Regarding the group expert question. I'm not sure how you would/could use the group expert to group a table? A table is a collection of fields and cannot be compared to another table without a complex algorithm. The group expert is used to group and sort records based on a field in the report. Have a look at the group expert section of the help file for more information.
    Hopefully my comments have given you a few ideas.

  • CLR trigger - handling multiple inserts at the same time

    Hi
    I've developed a CLR trigger which operates on inserts performed on a staging table. The trigger implements some business logic and then inserts or updates a record in a target table. Whether an insert or update is performed depends on whether
    a record with the same ID already exists in the target (i.e. a select * from target where ID = 123).
    This works fine in most scenarios, but occasionally I am getting duplicates in the target table and have noticed that this seems to occur when inserts on the staging table happen at exactly the same time (i.e. multiple inserts for the same ID at
    the same time). In this situation duplicates are created in the target table because at the time of the inserts, no record with that ID exists in the target table (i.e. the select returns no records), therefore a new record is created for each.
    Is there a known way to deal with this scenario? For example, would locking the target table on insert result in the subsequent selects against the target table waiting until the target table had been updated, therefore the select would return a record
    for the given ID.
    I didn't really want to lock the whole target table on insert, because there are potentially other users reading that table (selects) and these would also have to wait for the insert to complete.
    I'd appreciate any thoughts on how to deal with this and avoid duplicates in the target table. I'm unable to change the way the data is coming in to the staging table, so my trigger code must deal with the above scenario.
    Thanks in advance.
    John

    First if you do not want any duplicate values in a column (or combination of columns) you should add a constraint to ensure this is never possible. A
    unique index
    like this should do this trick.
    CREATE UNIQUE NONCLUSTERED INDEX [IX_yourIndexName] ON [dbo].[YourTableName]
    [yourColumn1] ASC,
    -- add more columns that make the unique combination that you don't want repeated
    You can then add a try/catch block in your trigger code, if you get an exception based on this index then the record was created by another executing instance of this trigger and in that case you should do an update (or not, not sure what the rest of your
    logic is) in your catch block. This is the easiest solution and does not involve table locks. The only drawback is the first one to commit the insert will win and you have no guarantee which process or data set that will be. Also i have no idea how big the
    table is, how frequently changes are made, and what the data type is so you should
    keep this in mind when creating your index so you don't run into unexpected high index fragmentation which can lead to performance problems when executing updates and inserts.
    You could also create a
    named transaction with scope serializable around your insert/update block and execute your reads using a
    NOLOCK hint
    which should allow them to retrieve uncommitted writes and not create a long wait. The downside is is that the data might not be 100% accurate depending on if a transaction fails or not if there happens to be an update at the same time as a select but maybe
    this is not a big deal to the calling code.
    -Igor

Maybe you are looking for