JPA: how to organize multiple databases having the same schema definition?

Hi there,
I'm new to Java EE but I could finish some test projects on GlassFish 3 / Java EE 6 platform.
Now it's time to build the actual system and I need some help in that.
So, I can't really tell you the exact purpose of this system but let's look at the following example which is very close to what I need.
Say there is a database schema definition (DDL) for Oracle 11g and this schema is storing the inventory of a shop. So tables like product, category, price etc
Say there are 50 shops, and I'm getting a new database for each shop every month holding their inventory.
So every month I'm receiving a SQL file with INSERTs (DML) for every shop for the DDL I mentioned above.
I'm getting 50 SQL files for the 50 shops every month, so in a year you're talking about 600 SQL files to import.
If it was php/MySQL I could import them into a separate database each, call it shop1_May11, shop2_May11 etc reflecting the shop name and the month in the database name.
This is my question how you guys think I should achieve this in Jave EE / Oracle.
As the DDL is the same I thought to create an Entity for each table and use the Java Persistance API to create the databases and then I'd import the month/shop specific SQL files.
But this means I'm gonna create 50 new schemas in Oracle every month?
Or what's the best way to achieve this?
Thanks in advance
Edited by: 833519 on May 18, 2011 5:28 AM
Edited by: 833519 on May 18, 2011 5:29 AM
Edited by: 833519 on May 18, 2011 5:31 AM

JPA helps a lot in persisting and retrieving data that has relationships without having to worry about the relationships at a sQL level.
So you get a java programmer that builds relationships using Java classes (the entities) and a persistence provider worries about the sql required to materialize those relationships.
You seem to be using SQL inserts for persisting the data and you want to generate the reports from SQL as well.
You can use it but you won't be gaining much of its advantages for this project.
Consider reporting applications like the jasperserver for the reports.
Also, I have seen people get away with using one database for this type of thing and just adding a clientid (and optionally branchid) to each table.

Similar Messages

  • How do i create multiple databases on the same unix box?

    Hello experts.
    Please send me some guidelines on how to create multiple databases on the same unix box and how to configure their startups including listeners.
    Please also, list me the possible precautions to takes especially if the existing database is a production one!
    thanks very much for you reply
    Best Regards
    Yogeeraj

    Hello,
    I tried the following:
    svrmgrl> startup nomount pfile=I:\d01\oracle\admin\cmttest\pfile\init.ora
    then
    svrmgrl> CREATE DATABASE cmttest
    LOGFILE 'i:\d01\oracle\oradata\cmttest\redo01.log' SIZE
    1024K,'i:\d01\oracle\oradata\cmttest\redo02.log' SIZE 1024K
    MAXLOGFILES 32
    MAXLOGMEMBERS 3
    MAXLOGHISTORY 1
    DATAFILE 'i:\d01\oracle\oradata\cmttest\system01.dbf' SIZE 50M REUSE
    MAXDATAFILES 254
    MAXINSTANCES 1
    CHARACTER SET WE8ISO8859P1
    NATIONAL CHARACTER SET WE8ISO8859P1;
    Then when i try to run both databases:
    svrmgrl> set instance cmttest
    ORA-12500: TNS: Listener failed to start a dedicated process
    ===================
    I am doing something wrong.
    please help
    Regards
    Yogeeraj

  • Transaction across multiple databases in the same BDB environment

    Hi,
    I have multiple databases and one metadata database all in the same BDB environment. At runtime I want to create an additional database, update this database and update the metadata database in the same environment under one transaction. Are there any issues in having transactions that span multiple databases in the same environment?
    Thanks,
    Pooja

    There is virtually no difference between using multiple databases and a single database in a transaction. Concurrency is determined by other factors such as whether multiple threads access the same records. See the Writing Transactional Applications for more information:
    http://www.oracle.com/technology/documentation/berkeley-db/je/TransactionGettingStarted/index.html
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Can you have multiple databases on the same LUN in Exchange 2010?

    I'm sure you can but is it possible with exchange 2010 to have multiple databases on the same LUN.  We currently have 8 DB's all writing to their own DB drive and separate log drive so 16 drives in total.  I need to spin a new DB up this week and
    wanted to double check this is possible.  I've looked online and cant find anything that I've seen before that says this is possible.
    Thanks.

    Hi,
    Yes, multiple databases could be placed on the same LUN, but it's not recommended.
    If you have 2 drives fail at the same time (it happens more than you think), then losing 100% of your DBs is a lot worse than losing one of them or some of them depending on where the failures are.
    Here is a similar thread for your reference:
    Multiple databases on the same LUN in Exchange 2010
    Hope this helps!
    Thanks.
    Niko Cheng
    TechNet Community Support

  • How to have multiple images on the same screen? like in the movies where you see several actions at

    how to have multiple images on the same screen? like in the movies where you see several actions at the same time ....
    i don't find  a tutorial in adobe tv....
    thanks !!

    The short answer is that you'll put the source clip(s) for each inset on a different video track, all stacked up. Then use the Scale and Position effects (under "Motion" on the Effect Controls panel) to reduce their size and place them where you want.
    If the content of an inset will involve edited content (where you're cutting among various clips or just trimming out unwanted content from a single clip), then you'll probably find it easier to do all those edits in one sequence, then nest that sequence in the master sequence, where you apply the Scale and Positioning effects. That will save the step of applying the scale and position effects to each edited track item.

  • How do I create multiple databases on the same ORACLE_HOME

    Hi,
    I would like to know how can I create 2 databases on the same ORACLE_HOME? Also is it possible to start both databases at the same time?
    When I installed oracle,a directory named database has been created under ORACLE_HOME, which contains all initorc1.ora ,etc ?
    At this point how do I create another database named orc2 on the same machine?
    Thanks in advance.
    winnie philip.

    Hi,
    Set the oracle_sid=db1
    Now rename your init.ora to init<oracle_sid>.ora in $oracle_home/dbs directory.
    Change the db_name parameter to appropriate name in the init<oracle_sid>.ora file.
    Now create the database.
    In the same fashion create another database with the new database name and different oracle_sid
    Now in order to switch between the databases.
    Change the env variable Oracle_Sid to the value of the database which you wanted to start.
    Regards
    Anand

  • How to support multiple users at the same time?

    Hi all,
    I have a Labview software which controls a analyzer via GPIB connector. When user A is using the software, user B has to wait until A is done. But actually, the analyzer is not very busy, when user A is using the software.
    I want user A, B, C and D can use the software at the same time. just like we can open Multiple websites at the same time.
    How can I program the software, so that the software can be open multiple times? Do you have any example?
    Thanks a lot.
    Steven
    Solved!
    Go to Solution.

    Are all the users going to be measuring the exact same thing from the same instrument?
    It would be possible to write a separate instrument server application that would handle all the direct interactions with the instrument. When one of the users needed to access the instrument, they would gain access to it through this server.
    The big, Big, BIG caveat is that each interaction with the instrument would need to be atomic. In other words each access would need to configure the instrument, initiate the reading, report the results, and then reset the instrument back to some known default value.
    As Dennis said, not a trivial process, but probably do-able...
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How to display multiple reports at the same time

    Hi,
    I'm trying to display multiple reports at the same time, each one in separates tabs or windows using Forms 11g 11.1.1.6
    I have a button which has a call to a procedure which makes use of rp2rro library to show the specific reports, for example:
    call_report('report1');
    call_report('report2');
    call_report('report3');
    call_report('report4');
    The main problem is that, just the last report is been displayed.
    Is there some way to display report1, report2 etc in separate tabs or windows ??
    Regards
    Carlos

    You shouldn't have a problem calling different reports at once. As long as you're using Forms 11g they show up in different windows.
    The question is how you are calling the report.
    Here is how I manipulate it.
    After I pass parameters with the ADD_PARAMETER built-in I set some key values (destype, desformat, desname) with the RP2RRO's procedures.
    Finally calling RP2RRO.RP2RRO_RUN_PRODUCT and then WEB.SHOW_DOCUMENT passing the correct procedure parameters the report comes up in a window. If you repeat the above changing the appropriate variables (the report_name in the RP2RRO_RUN_PRODUCT and so on) you can get multiple reports in different windows.

  • How to use multiple proxies at the same time?

    im planning to use multiple proxies at the same time on mac but i have no idea how to do it?!. i need help!thanks!

  • How to manage multiple sizes of the same image?

    I recently took up LightRoom for all the good things it does. One of the things I need to do, however, is to create and manage multiple sizes of the same image needed for different purposes. I always found this cumbersome. I totally expected that the LR library would offer a solution for this but I looked and I didn't see anything. Sure you can export and resize in the process but then you're on your own. Am I missing something? Isn't there a better way? What does Adobe have in mind for best practices and how do you handle this?

    I can't speak for 99jon, but when I need multiple sizes, I export at the desired sizes, and then make use of the exported photos (upload, e-mail, whatever) and then delete the exports. Thus, there's really no need for me to keep track of the photo at this specific size, knowing that if I ever need it again -- unlikely -- I can regenerate it with the export pre-set, so I put no effort (zero!) into keeping track of photos at different sizes.
    The idea of adding it back into the catalog doesn't get me excited, and I would advise against it. I don't need this, and I don't see the benefit of keeping this particular size export for the long-term. As I said, I can always recreate it — but maybe you have such a need to keep these exports long-term and recreating it at a later point in time doesn't meet your needs? Can you explain?
    By the way, you can't resize a virtual copy, so that won't work here. The only time you can resize is on export.

  • HT3529 How to delete multiple messages at the same time?

    I'm new with and IPhone I try to delete multiple messages at the same time. and I can't find how to do this.

    Email messages? Tap the edit button...tap each message you want to delete...hit delete...once in trash, tap edit, then tap delete all.

  • How to configure multiple clusters on the same machine.

    I am attempting to configure multiple clusters on the same set of machines. I have set the cluster name and multicase IP addresses to be different for each cluster. However I am still getting and error that states:
    "This indicates that there are multiple clusters on this network attempting to use overlapping network configurations."
    Is this not possible? If it is possible, is there some further way i need to tell the VMs they are part of different clusters?
    Thanks,
    Jacob

    FYI: I'm using the wrong multicast IP above. 224.0.0.1 is reserved and something else should be used. See:
    Re: UDP flood hosed my LAN?

  • How to use multiple Interfaces for the same BS?

    Hi @ ,
    Is it possible to have a scenarion where i am using multiple interfaces in the same BS based upon some conditional field in the message.
    I amnot able to get the solution I know with condition editor I can have multiple receivers but in my scenarion based upon message fiels i have to decide which BAPI to be used and wht mapping and then post it to the same System
    Any help will be highly rewarded
    Regards

    Hi-
    Yes it is possible you can use multimapping for mapping the interfaces.
    To know more about multimapping see
    http://help.sap.com/saphelp_nw04/helpdata/en/21/6faf35c2d74295a3cb97f6f3ccf43c/content.htm
    Some more helpful links
    /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible

  • How to avoid multiple session for the same username

    I need suggestions on implementing single user login , like My system has a user with a username jdavid and my application should not allow two different sessions for the same username jdavid , can one session peep into all other session
    to see if the any has a usernaem jdavid, I am basically looking for some pattern if any available for restricting multiple session for the same username . like jaas or any other security api provides this ?

    Store a Map<User, HttpSession> in application scope and let your application intercept on that. On login, just check if the User is already there, then get the associated HttpSession, invalidate it and replace it by the current HttpSession, else just store the current User-HttpSession pair in the map. On logout obviously remove the User-HttpSession pair from the map.

  • In OEM 12c, how to manage multiple incidents at the same time?

    Hi,
    Is there a way to manage multiple incidents at the same time? For example, if I want to assign owner for multiple incidents in the incident manager, is there a way to do this? Thanks for the help.

    This is currently not supported. This support will be available as part of the next patch set release.
    Please note that you can use Incident rules to assign owners to incidents as they come in or get updated.

Maybe you are looking for

  • How can I view all comments in a Pages doc and print the doc with comments?

    It seems that we can no longer view comments in the margin of a document.  It is also not possible to print the document with comments visible.  Anyone else having this problem?  Pages 09 Help does not even offer an up-to-date explanation.  "Show Com

  • Incorrect Number error message only started today ...

    Hi there Had my N900 since July and this is first time I have had major problem.. Really weird...I text my wife everyday and have been doing so today as well..but within the last half hour, when I try to SMS her, I get an "Incorrect Number" error mes

  • Issue JavaThread in Java VM

    # A fatal error has been detected by the Java Runtime Environment: # SIGSEGV (0xb) at pc=0xcdb40d0c, pid=1584, tid=20 # JRE version: 6.0_14-b08 # Java VM: Java HotSpot(TM) Client VM (14.0-b16 mixed mode, sharing solaris-x86 ) # Problematic frame: # C

  • MPG4 video wont transfer to itunes

    Hey everybody: My problem: I had a CD of 3 video files(the original format was 3GPP2 of 2 of them, and MPG4 of one of them -- Call them files 1, 2, and 3). The third file I was able to drag and drop into itunes, and I got it on my video ipod (all tho

  • Get name in tool area of framework page

    hi experts, > default welcome <name> will be in masthead of framework page. how to get welcome <name> in the tool  area, of default framework page which is below to masthead. can anyone guide on this issue, indetails step by step thank you in advance