What is the best form to control a open of database?

Hi,
what is the best form to open a database?
I´m understood that Environment is unique for all aplication, and I think that it is good to put on Singleton Pattern, but I don´t know the best form to do it with the databases.
I think two forms, the first is create a singleton open database, with this form I don´t will close the database and all application will use it. So, the second form is open a data base at the moment that I will use it, for example, into a DAO when I will do inserts, deletes, etc, and at the final of the operation I close the database.
So, I don´t know what form is the best, and if those forms are corrects, if exist another form to do it I would like to know.

Hugo,
An application can choose to use one or more Environment and Database instances in a single process. In other words, it is the application's choice whether it wants to instantiate a single Environment or Database and share it among multiple threads, or whether it wants to instantiate multiple instances.
Choosing one pattern or another is a function of your application's design, and performance considerations. As you say, you could instantiate a single Database instance and pass it around, or you could open and close the Database every time you get a data record. A third choice is to open a Database instance per thread, and reuse that for the life of the application.
The second choice of opening and closing the Database per data record access is pretty heavyweight from a performance point of view. There is a fair bit of overhead to the initial open of a database, and to the final close. Follow-on opens are not as heavyweight, but do have some cost. For example:
// expensive
thread 1 calls Environment.openDatabase() or new EntityStore()
// less expensive, database is already open, thread 2 is really just getting a handle
// onto the database, but still more expensive than a read or write of a data record
thread 2 calls Environment.openDatabase() or new EntityStore()
The first choice of using a single Database instance in your process will perform much better. If your application has a high level of concurrency, there can be some contention on the Database instance, described in this FAQ - http://www.oracle.com/technology/products/berkeley-db/faq/je_faq.html#32 and you may prefer to try the third option of using a Database instance per thread.
Regards,
Linda

Similar Messages

  • What is the best way to control a mac mini with iphone 4s , prefer blue tooth

    Hi
    what is the best way to control a mac mini with iphone 4s , prefer blue tooth, or I can use the syncing cable as well. but no wifi.
    Basically to lanch an app and load a preset for that app.
    Thank you

    As V.K. noted, check out NetRestore's documentation http://www.bombich.com/software/docs/netrestore/English/index.html or visit the fourms at http://forums.bombich.com/

  • What is the best way is to implement a friend database

    Hi
    I was wondering what the best way is to implement a friend database. E.g. facebook where a person can have friends.
    Would you create a person table and a friendtable where each entry in the friendtable contains the owners personid and the friends personid?
    I would like to to view the picture of Darwin Cabigas Cano?
    Please..

    We call it as Database Design.
    Yes, you can have one table as Person and Friends table which should refer to your Person table.
    It should look like below: (Reference:
    Facebook Style Friend Request System Database Design )
    -Vaibhav Chaudhari

  • What's the best free tool to populate an Oracle database?

    I'm looking for a free tool to populate an Oracle Database 10g for testing purposes.
    Does anybody know the best one?
    Thanks,
    Carlos Felipe

    Hi Carlos,
    I'm looking for a free tool to populate an Oracle Database 10g for testing purposes.If you want to load test data, you may want to spend a bit and get something goog.
    There are several tools and methods for generating test data for Oracle:
    STATSPACK - You can easily write your own SQL capture, directly from the STATSPACK stats$sqlstat table.
    AWR - AWR captures historical SQL in the dba_hist_sqlstat table.
    SQL Tuning Sets – This 10g tool grabs SQL from the library cache or Oracle.
    SQL Performance Analyzer (SPA)  – This new 11g tool captures representative SQL workloads.
    Mercury LoadRunner  - A popular tools for simulating the real-world effect of an Oracle system change.
    Quest Benchmark Factory - A complete environment for showing the effects of an Oracle change.
    DBGEN - The TPC-H tools, dbgen and qgen allow for the development of anywhere from a gig to a terabyte databases.
    Hammerora - The Hammerora product provides a means to create a pseudo-TPC-C database and generate loads against it.
    Hope this answers your question . . .
    Donald K. Burleson
    Oracle Press author

  • What is the best method for controlling a data switch of 20x20 ports, with local and remote requests?

    I'm using booleon control boxes for 'source' ports - to be connected to 'customers' ports. Am not sure of choosing between arrays, clusters, case, etc.

    Thanks, however, I simply meant my boolean 'ports' to mean a 'yes/no' control box of a 'data source', which, when selected, would signify a 'source' that could then be connected to a 'customer' port or 'receiving box'. Perhaps instead of port, I should have said input/output box.
    My main question is simply about a data switch matrix of 20 inputs and 20 outputs. Should I attempt to manage the switching of data lines via cases, for loops, sequence, or what! I believe I will need to set up arrays, but controlling the matrix is ???. Thanks.

  • What is the best way to control pdf display in web browser - the preferences settings don't seem to work?

    I'm able to display the pdf in the browser - but it comes in too large and the first page is a single and the second pages are a double page - and i don't want it to scroll. there must be soem script to control this?

    Browser Troubleshooting
    "Can't view PDF on the web" 
    http://helpx.adobe.com/acrobat/kb/cant-view-pdf-web.html 
    "Display PDF in browser"
    http://helpx.adobe.com/acrobat/using/display-pdf-browser-acrobat-xi.html 
    Be well...

  • What is the best strategy to purge a set of database tables.

    Hi,
    I have 6 tables I would require to purge data from.
    1 parent table - All of the data that needs to be purged are from a partition created on this table
    5 child table - Using the parent record identifier, these records needs to be purged as well.
    The count of the parent table that i would be purging is around 6 * 10^6
    and the child tables contain atleast 12 * 10^6.
    Can some 1 let me know the most efficient way to get this done.
    If i am using delete statements - if there are any oracle hints that would speed up the process.
    Are there any alternatives to execute a delete script versus how a dba can help out getting the same done within the shortest period of time possible?

    Welcome to the forum.
    Are all tables partitioned?
    What database version are you working with?
    Dropping partitions sounds like a good option you have.
    But there are several other ways, like create table as select [records you want to keep].
    Even DBMS_REDEFINITION pops into my mind...
    These threads will give you more ideas: http://asktom.oracle.com/pls/asktom/asktom.search?p_string=%22mass+delete%22

  • What is the best directory / location to store master document database?

    I would like to store my master database containing 14GB of data on the iPhone itself, and then use that to connect to my Mac computers (either the desktop, or one of my laptops). So I have a couple of choices that I am aware of. I can store everything inside of the Documents to Go directory. Or, I can store everything inside of OneDisk because that lets me upload to the cloud. It gets a little confusing to store data in the iDisk directory on the iPhone because each file that is downloaded gets its own folder with a very long name that is worthless in terms of organization. I am happy to keep a duplicate in the cloud of all 14GB, but I want the most current database to be on my phone. For OneDisk to upload, it looks like things need to be inside the OneDisk directory. Any suggestions? I want an organizational system that can be used at least until the next iPhone comes out. Thanks.

    If your XML data will not be larger than 4000 characters then use VARCHAR2 else CLOB. I don't see a need to use BLOB (unless your XML data contains binary information).

  • What is the best MIDI controller for Logic, and is Axiom Pro the only line with "Hyper Control?

    What is the best MIDI keyboard/control surface to use with LOGIC (Studio - which I assume is the latest & greatest version) and is Axiom Pro the only line that has Hyper control? I already own the Axiom Pro 61, but prefer more keys, and though I like much about it, the keys aren't very easy for playing more complex material, and there is an obvious delay regarding attack response (esp. noticeable at faster speeds). There are other issues as well I've read of regarding key sticking (though I consider myself lucky mine do not, there is nontheless a sluggish clunckiness issue which neither helps agility/acuracy nor the delay factor.) and the unit not lasting very long before it breaks and needs repairing. And lastly, I am no fan of Avid and care not to support them in the least.

    Sorry, but is this an iPad question? Axiom Pro 61 is not an iPad-compatible peripheral, so perhaps you mean to post in the Logic forum?

  • What is the best way to organize pictures for huge library?

    Hello.
    I have lost 3 evenings of work the last week after the corruption of the iPhoto database. I lose my temper now . it was not the first time. but I’m ready to take long term action to improve the situation.
    I have now around 15.000 pics & something like 15 Go of data. That means I have to use an external drive to store them all. Each team the connection between the external HD & my iBook is lost, not often but can happen, the database is bugged. Of course I gonna have more and more pictures in the future, I took 5.000 Go of pictures back from Australia.
    My question is very general, what is the best way to handle this kind of database size?
    Okay, now I know that I should bake-up the Library6.iPhoto file. What else?
    Could I archive my rolls on CDs (well I should do it anyway) & delete the rolls from the database afterwards? What about the photo album? Is it possible to restore the pictures from the CDs to the hard drive?
    I have read that I should create several libraries. That could be a solution. Is it possible to split the current one? I could import the pictures in a new library, but in this case I will lose the comments field.
    I would really appreciate if you could send me your feedback about handling this size of library. Thanks in advance.

    Arnaud:
    There's is a way you can have your library on your boot drive and keep the "source" files on the external. It's using iPhoto in it's alias mode. There are pluses and minuses to this system. The pluses are that you can have a very large library. I have 18,000+ photos in my alias library. The iPhoto Library folder on my boot drive is only 1.7MB while the source files on my external HD take up 27G.
    The minuses are 1: if the external HD is not mounted then you can only view the thumbnail files and any full sized files that have been edited (the edited version is saved to the iPhoto Library folder). Any operation that requires moving a thumbnail or using the full sized version can't be run. 2: if you delete a photo from your library the "source" file does not get deleted. You'll have to do that via the Finder. 3: When you add new files it's best if you put them in their own folder with the other source folders and then import. If you try to put them in another folder it you'll have to import them manually instead of just dragging the entire new folder into iPhoto to create a new roll.
    I've created some Tutorials to help users convert and use this type of library. It's not for everyone but may hold some pluses for your situation.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've written an Automator workflow application, iPhoto dB file backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.
    G5 Dual Core 2GHz, 2G RAM, 250G HD; G4 Dual 1Ghz, 1.5G RAM, 80G HD,   Mac OS X (10.4.8)   QT 7.1.3, 22 LCD, 200 & 160G FW HDs, Canon S400, i850 & LIDE 50, Epson R200

  • What is the best editor to use for JSP/Servlet?

    Hello,
    What is the best editor to use for JSP/Servlet database development.
    I'm looking at Dreamweaver,Java Studio Creator.
    I want some thing fairly easy to use that has database helper wizards like dreamweaver.
    Thanks for the help.
    Frank

    Is it better to have a servlet do the database work and call it from JSP?No, it's better to have persistence objects do the database work. Servlets handle HTTP requests, and JSPs are HTML factories that should be pure view.
    But there are lots of ways to do things. You just have to understand the tradeoffs when you decide.
    I do not want to hammer out code, I want to learn the
    best way to do things from experienced developers. Sorry, sounded like you just wanted to churn stuff.
    "best way" can be subjective. In one app, "best" might be "delivered fastest". For another, "best" might be "most secure" or "most easily modified" or "best performing" or whatever. You won't get a "best" answer, only different choices. And they aren't always so easy to explain or execute.
    I'd recommend that you start by reading about layered applications (3-tier architectures) and MVC separation. Once you've Googled enough about that, look into a framework like Struts or Spring or WebWork. That'll help you figure out where to put each responsibility in your app.
    I can use dreamweaver to create web apps, but I hate
    the arrays used to define fields. It also seems not
    to take advantage of connection pooling.Don't know what you're talking about here, Frank. What do fields have to do with connection pooling?
    %

  • What is the best way to clone a form field in BC

    Hi,
    What is the best way to clone a form field in BC.  I tried using jquery .clone.  It works fine on other forms for me but not on the BC forms, why? is it just me?  Any help would be great. Thanks

    I mean, duplicate a field with the click of a button.
    I think this should work, but it's not and  I am linked to the jquery library in the head of my page.
    <script type="text/javascript">
    $(document).ready(
      function() {
        $('input#tmpAddRow').click(
          function($e) {
            $e.preventDefault();
            $('tr#tmp').clone(true).removeAttr('id').appendTo('tbody');
        $('tr input[type=text]').focus(
          function() {
            $(this).addClass('myFocused');  
        ).blur(
          function() {
            $(this).removeClass('myFocused');
        </script>
    <img alt="" style="border: 0px solid; width: 200px; height: 134px; float: left;" src="/images/pv logo 3d.png" />
    <h3 style="text-align: center; color: #0000ff; text-shadow: #999999 0px 1px 5px;">Member Directory Listing</h3>
    <p style="text-align: center;">If you would like to be listed in the Pine Valley Middle School Directory, please fill out this form.  Only fill out the areas you would like to show up in our Directory.</p>
    <div style="margin-left: 130px;" class="form_bg">
    <form action="/CustomContentProcess.aspx?CCID=5656&amp;OID={module_oid}&amp;OTYPE={module_otype }" method="post" enctype="multipart/form-data" onsubmit="return checkWholeForm45842(this)" name="catcustomcontentform45842">
        <table cellspacing="0" cellpadding="2" border="0" class="webform">
            <tbody>
                <tr>
                    <td id="tmp"><label for="ItemName">First Name</label><br />
                    <input type="text" value="{module_firstname}" maxlength="255" id="ItemName" name="ItemName" class="cat_textbox_small" /><br />
                    <input type="button" id="tmpAddRow" value="Add a Row" />
                    </td>
                </tr>
                <tr>
                    <td><label for="CAT_Custom_131512">Last Name</label><br />
                    <input type="text" value="{module_lastname}" class="cat_textbox" id="CAT_Custom_131512" name="CAT_Custom_131512" maxlength="1024" /></td>
                </tr>
                <tr>
                    <td><label for="CAT_Custom_131509">Number</label><br />
                    <input type="text" value="{module_homephone}" class="cat_textbox" id="CAT_Custom_131509" name="CAT_Custom_131509" maxlength="1024" />
                    </td>
                </tr>
                <tr>
                    <td><label for="CAT_Custom_131510">Email</label><br />
                    <input type="text" value="{module_emailaddress}" class="cat_textbox" id="CAT_Custom_131510" name="CAT_Custom_131510" maxlength="1024" /></td>
                </tr>
                <tr>
                    <td><label for="ItemAddress">Address</label><br />
                    <input type="text" value="{module_homeaddress}" maxlength="500" class="cat_textbox" id="ItemAddress" name="ItemAddress" />
                    </td>
                </tr>
                <tr>
                    <td><label for="ItemCity">City</label><br />
                    <input type="text" value="{module_homecity}" maxlength="255" class="cat_textbox" id="ItemCity" name="ItemCity" /></td>
                </tr>
                <tr>
                    <td><label for="ItemState">State</label><br />
                    <input type="text" value="{module_homestate}" maxlength="255" class="cat_textbox" id="ItemState" name="ItemState" />
                    </td>
                </tr>
                <tr>
                    <td><label for="ItemZip">Zipcode/Postcode</label><br />
                    <input type="text" value="{module_homezip}" maxlength="255" class="cat_textbox" id="ItemZip" name="ItemZip" /></td>
                </tr>
                <tr>
                    <td class="hidden"><label for="FirstName">First Name</label><br />
                    <input type="text" value="{module_firstname}" class="cat_textbox" id="FirstName" name="CAT_Custom_131511" maxlength="1024" /></td>
                </tr>
                <tr>
                    <td><input type="submit" id="catcustomcontentbutton" value="Submit" class="cat_button" /></td>
                </tr>
            </tbody>
        </table>
        <script type="text/javascript" src="/CatalystScripts/ValidationFunctions.js"></script>
        <script type="text/javascript" src="/CatalystScripts/Java_DatePicker.js"></script>
        <script type="text/javascript">
    //<![CDATA[
    var submitcount45842 = 0;function checkWholeForm45842(theForm){var why = "";if (theForm.ItemName) why += isEmpty(theForm.ItemName.value, "Item Name");if (theForm.Days) why += isNumericIfVisible(theForm.Days, "days"); if (why != ""){alert(why);return false;}if(submitcount45842 == 0){submitcount45842++;theForm.submit();return false;}else{alert("Form submission is in progress.");return false;}}
    //]]>
    </script>
        <script type="text/javascript">
        jQuery("#ItemName").blur(function(){
            jQuery("#FirstName").val(jQuery("#ItemName").val());
    </script>
    </form>
    </div>

  • What is the best voice control program for macbook pro

    what is the best voice control program for macbook pro?
    i have lost the use of my arms and need full voice control.
    thank you.

    Welcome to the Apple Support Communities
    First, use speech recognition. It's installed on OS X, so you don't have to install a third-party app. See > http://support.apple.com/kb/PH11258?viewlocale=en_US

  • What is the best way to migrate from Forms to ADF?

    We are in a big quagmire. Our company has been into Oracle Forms development for over 15 years. We have applications developed in Forms 6i and 10g. We have about 5 products and these 5 products have about 25 to 30 different versions. i.e. we maintain about 30 different versions of our applications. Each version of the application has about 100 forms and 100 reports.
    Now, since Forms has come to the End of life from 11g we want to move to ADF. We tried Forms to ADF migration tools but failed. So now we have decided to manually rewrite the applications in ADF.
    Our Forms / PL/SQL developers, designers and analysts (total about 40) are all Oracle Forms people. They have no experience in Java.
    What I want to know is:
    (1.) What is the BEST way to achieve this?
    (2.) Do we have to learn Java, JSF and ADF?? (i.e. All 3)?
    (3.) Is it mandatory to learn JSF??
    (4.) Assuming, comprehensive training can be given, how long will it take for Forms people to learn ADF?
    (5.) What type of training will be required?? (Java, JSF, ADF, JDeveloper etc.)
    (6.) How LONG will this take? i.e. to train all 40 and then get rewrite an application of 100+ forms and 100+ reports? (Ballpark is OK).
    (7.) Any other technologies we should learn??
    Edited by: user12240205 on Jul 18, 2012 5:48 AM

    Obvoiusly the longer you have for training the better but I think the minimum would be
    1) Java skills - I think to start off, 1 or two days reading something like Head First Java http://www.amazon.com/Head-First-Java-Kathy-Sierra/dp/0596009208
    2) I'd then get "The Quick Start Guide to Fusion Development" http://www.amazon.com/Quick-Start-Oracle-Fusion-Development/dp/0071744282/ref=sr_1_1?s=books&ie=UTF8&qid=1343201618&sr=1-1&keywords=jdeveloper+quick (declaration: I'm the author so have a vested interest, but I still think its a good place to start. - this should be about 2-3 days to read and also to try things out.
    3) In parallel I'd be watching these ADF Insider Basics http://www.oracle.com/technetwork/developer-tools/adf/learnmore/adfinsider-093342.html#a1 - a couple of hours
    4) I'd then try this tutorial http://www.oracle.com/webfolder/technetwork/tutorials/obe/jdev/obe11jdev/ps1/ria_application/developriaapplication_long.htm - 3 hours.
    5) Optionally, if you are coming from a Forms background I would also read http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/SummitADF/SummitADF_Redevelopment.pdf and watch http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/Forms_Redevelopment_ADF/Forms_Redevelopment_ADF.html - which is about 2 hours of work.
    I think this would be the absolute MINIMUM to at least be able to build some basic applications and to start feeling your way - everything else outlined in the "ADF COLLATERAL TOUR" http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/ADFTour/ADFTour.html could be learned as you start building some proof of concept. However, I'd wouldn't suggest you try building a real application with only one weeks exposure (in the same way I wouldn't expect you to design a product database with only one week training). I would probably expect your developers to have at least the above training and then spend about a month or so (minimum) building proof of concepts (or testing themselves with the ADF Insider Essentials Tasks). Furthermore, I'd probably expect you to have at least on senior developer/architect, with much more experience who can be making decisions on things like reuse, partitioning, architecture etc.
    Of course, this is all subjective but I hope it helps.
    regards
    Grant
    ps
    Of course, we also have formal Oracle University Training courses which you could attend (or they can be purchased to watch on line).

  • Form fields in LiveCycle. I want to allow users to add URLs to a form so that they can be clicked and opened on the web by form reviewers (users). what is the best way to achieve this?

    Form fields in LiveCycle. I want to allow users to add URLs to a form so that they can be clicked and opened on the web by form reviewers (users). what is the best way to achieve this?

    Once the user has entered the URL they want to add to the form. You can use the loadXML function to implement some special text in a label...
    var linkValue = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><exData contentType=\"text/html\" xmlns=\"http://www.xfa.org/schema/xfa-template/2.8/\"><body xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:xfa=\"http://www.xfa.org/schema/xfa-data/1.0/\" xfa:APIVersion=\"Acroform:2.7.0.0\" xfa:spec=\"2.1\"><p style=\"font-weight:bold;text-decoration:none;letter-spacing:0in\">The new link the user have entered is:<a href=\"" + textfield.rawValue + "\">textfield.rawValue</a></p></body></exData>";
      this.resolveNode("lblURL").value.exData.loadXML(linkValue, 1, 1);

Maybe you are looking for