Multi - environment application

We need to build an application that uses DBsession s.o. in order to
access remote Oracle databases without SQL*NET connections or any
vendor-provided connectivity products , but only with Forte middleware.
The application must be multi environment, so we cannot setup only one
big environment that groups all the dbs. We're trying to use reference
partitions to access dbsession on the remote environments, but we would
like this thing performed in a dinamical way. We would like to change
the env search path inside the service object itself, or , in
alternative, inside the application. Unfortunately, the tech.note 10425
says that the only way to change the env.search path dinamically is to
change it inside the nameservice subagent. But this should affect all
the service objects only when these will be restarted. Can we access a
remote service (in other words, a service object on a reference
partition) only when (and where) we want to do that ??
Thank you in advance.
Michele Amato [email protected]
Forte' Developer phone: +39 39- 6864542 Milano
+39 828- 398366 Battipaglia
Alcatel Telecom Italia

Feel free to consider this issues closed.
We figured it out.
We used the combination of a filter event trapping off a user action, coupled with PL/SQL code to extract values from the filtered event and inserted them into the appropriate table{s}.

Similar Messages

  • Global-Cache-Manager for Multi-Environment Applications

    Hi,
    Within our server implementation we provide a "multi-project" environment. Each project is fully isolated from the rest of the server e.g. in terms of file-system usage, backup and other ressources. As one might expect the way to go is using a single VM with multiple BDB environments.
    Obviously each JE-Environment uses its own cache. Within a our environment with dynamic numbers of active projects this causes a problem because the optimal cache configuration within a given memory frame depends on the JE-Environments in use BUT there is no way to define a global JE cache for ALL JE-Environments.
    Our "plan of attack" is to implement a Global-Cache-Manager to dynamicly configure the cache sizes of all active BDB environments depending on the given global cache size.
    Like Federico proposed the starting point for determining the optimal cache setting at load time will be a modification to the DbCacheSize utility so that the return value can be picked up easily, rather than printed to stdout. After that the EnvironmentMutableConfig.setCacheSize will be used to set the cache size. If there is enough Cache-RAM available we could even set a larger cache but I do not know if that really makes sense.
    If Cache-Memory is getting tight loading another BDB environment means decreasing cache sizes for the already loaded environments. This is also done via EnvironmentMutableConfig.setCacheSize. Are there any timing conditions one should obey before assuming the memory is really available? To determine if there are any BDB environments that do not use their cache one could query each cache utilization using EnvironmentStats.getCacheDataBytes() and getCacheTotalBytes().
    Are there any comments to this plan? Is there perhaps a better solution or even an implementation?
    Do you think a global cache manager is something worth back-donating?
    Related Postings: Multiple envs in one process?
    Stefan Walgenbach

    Here is the updated DbCacheSize.java to allow calling it with an API.
    Charles Lamb
    * See the file LICENSE for redistribution information.
    * Copyright (c) 2005-2006
    *      Oracle Corporation.  All rights reserved.
    * $Id: DbCacheSize.java,v 1.8 2006/09/12 19:16:59 cwl Exp $
    package com.sleepycat.je.util;
    import java.io.File;
    import java.io.PrintStream;
    import java.math.BigInteger;
    import java.text.NumberFormat;
    import java.util.Random;
    import com.sleepycat.je.Database;
    import com.sleepycat.je.DatabaseConfig;
    import com.sleepycat.je.DatabaseEntry;
    import com.sleepycat.je.DatabaseException;
    import com.sleepycat.je.Environment;
    import com.sleepycat.je.EnvironmentConfig;
    import com.sleepycat.je.EnvironmentStats;
    import com.sleepycat.je.OperationStatus;
    import com.sleepycat.je.dbi.MemoryBudget;
    import com.sleepycat.je.utilint.CmdUtil;
    * Estimating JE in-memory sizes as a function of key and data size is not
    * straightforward for two reasons. There is some fixed overhead for each btree
    * internal node, so tree fanout and degree of node sparseness impacts memory
    * consumption. In addition, JE compresses some of the internal nodes where
    * possible, but compression depends on on-disk layouts.
    * DbCacheSize is an aid for estimating cache sizes. To get an estimate of the
    * in-memory footprint for a given database, specify the number of records and
    * record characteristics and DbCacheSize will return a minimum and maximum
    * estimate of the cache size required for holding the database in memory.
    * If the user specifies the record's data size, the utility will return both
    * values for holding just the internal nodes of the btree, and for holding the
    * entire database in cache.
    * Note that "cache size" is a percentage more than "btree size", to cover
    * general environment resources like log buffers. Each invocation of the
    * utility returns an estimate for a single database in an environment.  For an
    * environment with multiple databases, run the utility for each database, add
    * up the btree sizes, and then add 10 percent.
    * Note that the utility does not yet cover duplicate records and the API is
    * subject to change release to release.
    * The only required parameters are the number of records and key size.
    * Data size, non-tree cache overhead, btree fanout, and other parameters
    * can also be provided. For example:
    * $ java DbCacheSize -records 554719 -key 16 -data 100
    * Inputs: records=554719 keySize=16 dataSize=100 nodeMax=128 density=80%
    * overhead=10%
    *    Cache Size      Btree Size  Description
    *    30,547,440      27,492,696  Minimum, internal nodes only
    *    41,460,720      37,314,648  Maximum, internal nodes only
    *   114,371,644     102,934,480  Minimum, internal nodes and leaf nodes
    *   125,284,924     112,756,432  Maximum, internal nodes and leaf nodes
    * Btree levels: 3
    * This says that the minimum cache size to hold only the internal nodes of the
    * btree in cache is approximately 30MB. The maximum size to hold the entire
    * database in cache, both internal nodes and datarecords, is 125Mb.
    public class DbCacheSize {
        private static final NumberFormat INT_FORMAT =
            NumberFormat.getIntegerInstance();
        private static final String HEADER =
            "    Cache Size      Btree Size  Description\n" +
        //   12345678901234  12345678901234
        //                 12
        private static final int COLUMN_WIDTH = 14;
        private static final int COLUMN_SEPARATOR = 2;
        private long records;
        private int keySize;
        private int dataSize;
        private int nodeMax;
        private int density;
        private long overhead;
        private long minInBtreeSize;
        private long maxInBtreeSize;
        private long minInCacheSize;
        private long maxInCacheSize;
        private long maxInBtreeSizeWithData;
        private long maxInCacheSizeWithData;
        private long minInBtreeSizeWithData;
        private long minInCacheSizeWithData;
        private int nLevels = 1;
        public DbCacheSize (long records,
                   int keySize,
                   int dataSize,
                   int nodeMax,
                   int density,
                   long overhead) {
         this.records = records;
         this.keySize = keySize;
         this.dataSize = dataSize;
         this.nodeMax = nodeMax;
         this.density = density;
         this.overhead = overhead;
        public long getMinCacheSizeInternalNodesOnly() {
         return minInCacheSize;
        public long getMaxCacheSizeInternalNodesOnly() {
         return maxInCacheSize;
        public long getMinBtreeSizeInternalNodesOnly() {
         return minInBtreeSize;
        public long getMaxBtreeSizeInternalNodesOnly() {
         return maxInBtreeSize;
        public long getMinCacheSizeWithData() {
         return minInCacheSizeWithData;
        public long getMaxCacheSizeWithData() {
         return maxInCacheSizeWithData;
        public long getMinBtreeSizeWithData() {
         return minInBtreeSizeWithData;
        public long getMaxBtreeSizeWithData() {
         return maxInBtreeSizeWithData;
        public int getNLevels() {
         return nLevels;
        public static void main(String[] args) {
            try {
                long records = 0;
                int keySize = 0;
                int dataSize = 0;
                int nodeMax = 128;
                int density = 80;
                long overhead = 0;
                File measureDir = null;
                boolean measureRandom = false;
                for (int i = 0; i < args.length; i += 1) {
                    String name = args;
    String val = null;
    if (i < args.length - 1 && !args[i + 1].startsWith("-")) {
    i += 1;
    val = args[i];
    if (name.equals("-records")) {
    if (val == null) {
    usage("No value after -records");
    try {
    records = Long.parseLong(val);
    } catch (NumberFormatException e) {
    usage(val + " is not a number");
    if (records <= 0) {
    usage(val + " is not a positive integer");
    } else if (name.equals("-key")) {
    if (val == null) {
    usage("No value after -key");
    try {
    keySize = Integer.parseInt(val);
    } catch (NumberFormatException e) {
    usage(val + " is not a number");
    if (keySize <= 0) {
    usage(val + " is not a positive integer");
    } else if (name.equals("-data")) {
    if (val == null) {
    usage("No value after -data");
    try {
    dataSize = Integer.parseInt(val);
    } catch (NumberFormatException e) {
    usage(val + " is not a number");
    if (dataSize <= 0) {
    usage(val + " is not a positive integer");
    } else if (name.equals("-nodemax")) {
    if (val == null) {
    usage("No value after -nodemax");
    try {
    nodeMax = Integer.parseInt(val);
    } catch (NumberFormatException e) {
    usage(val + " is not a number");
    if (nodeMax <= 0) {
    usage(val + " is not a positive integer");
    } else if (name.equals("-density")) {
    if (val == null) {
    usage("No value after -density");
    try {
    density = Integer.parseInt(val);
    } catch (NumberFormatException e) {
    usage(val + " is not a number");
    if (density < 1 || density > 100) {
    usage(val + " is not betwen 1 and 100");
    } else if (name.equals("-overhead")) {
    if (val == null) {
    usage("No value after -overhead");
    try {
    overhead = Long.parseLong(val);
    } catch (NumberFormatException e) {
    usage(val + " is not a number");
    if (overhead < 0) {
    usage(val + " is not a non-negative integer");
    } else if (name.equals("-measure")) {
    if (val == null) {
    usage("No value after -measure");
    measureDir = new File(val);
    } else if (name.equals("-measurerandom")) {
    measureRandom = true;
    } else {
    usage("Unknown arg: " + name);
    if (records == 0) {
    usage("-records not specified");
    if (keySize == 0) {
    usage("-key not specified");
         DbCacheSize dbCacheSize = new DbCacheSize
              (records, keySize, dataSize, nodeMax, density, overhead);
         dbCacheSize.caclulateCacheSizes();
         dbCacheSize.printCacheSizes(System.out);
    if (measureDir != null) {
    measure(System.out, measureDir, records, keySize, dataSize,
    nodeMax, measureRandom);
    } catch (Throwable e) {
    e.printStackTrace(System.out);
    private static void usage(String msg) {
    if (msg != null) {
    System.out.println(msg);
    System.out.println
    ("usage:" +
    "\njava " + CmdUtil.getJavaCommand(DbCacheSize.class) +
    "\n -records <count>" +
    "\n # Total records (key/data pairs); required" +
    "\n -key <bytes> " +
    "\n # Average key bytes per record; required" +
    "\n [-data <bytes>]" +
    "\n # Average data bytes per record; if omitted no leaf" +
    "\n # node sizes are included in the output" +
    "\n [-nodemax <entries>]" +
    "\n # Number of entries per Btree node; default: 128" +
    "\n [-density <percentage>]" +
    "\n # Percentage of node entries occupied; default: 80" +
    "\n [-overhead <bytes>]" +
    "\n # Overhead of non-Btree objects (log buffers, locks," +
    "\n # etc); default: 10% of total cache size" +
    "\n [-measure <environmentHomeDirectory>]" +
    "\n # An empty directory used to write a database to find" +
    "\n # the actual cache size; default: do not measure" +
    "\n [-measurerandom" +
    "\n # With -measure insert randomly generated keys;" +
    "\n # default: insert sequential keys");
    System.exit(2);
    private void caclulateCacheSizes() {
    int nodeAvg = (nodeMax * density) / 100;
    long nBinEntries = (records * nodeMax) / nodeAvg;
    long nBinNodes = (nBinEntries + nodeMax - 1) / nodeMax;
    long nInNodes = 0;
         long lnSize = 0;
    for (long n = nBinNodes; n > 0; n /= nodeMax) {
    nInNodes += n;
    nLevels += 1;
    minInBtreeSize = nInNodes *
         calcInSize(nodeMax, nodeAvg, keySize, true);
    maxInBtreeSize = nInNodes *
         calcInSize(nodeMax, nodeAvg, keySize, false);
         minInCacheSize = calculateOverhead(minInBtreeSize, overhead);
         maxInCacheSize = calculateOverhead(maxInBtreeSize, overhead);
    if (dataSize > 0) {
    lnSize = records * calcLnSize(dataSize);
         maxInBtreeSizeWithData = maxInBtreeSize + lnSize;
         maxInCacheSizeWithData = calculateOverhead(maxInBtreeSizeWithData,
                                  overhead);
         minInBtreeSizeWithData = minInBtreeSize + lnSize;
         minInCacheSizeWithData = calculateOverhead(minInBtreeSizeWithData,
                                  overhead);
    private void printCacheSizes(PrintStream out) {
    out.println("Inputs:" +
    " records=" + records +
    " keySize=" + keySize +
    " dataSize=" + dataSize +
    " nodeMax=" + nodeMax +
    " density=" + density + '%' +
    " overhead=" + ((overhead > 0) ? overhead : 10) + "%");
    out.println();
    out.println(HEADER);
    out.println(line(minInBtreeSize, minInCacheSize,
                   "Minimum, internal nodes only"));
    out.println(line(maxInBtreeSize, maxInCacheSize,
                   "Maximum, internal nodes only"));
    if (dataSize > 0) {
    out.println(line(minInBtreeSizeWithData,
                   minInCacheSizeWithData,
                   "Minimum, internal nodes and leaf nodes"));
    out.println(line(maxInBtreeSizeWithData,
                   maxInCacheSizeWithData,
    "Maximum, internal nodes and leaf nodes"));
    } else {
    out.println("\nTo get leaf node sizing specify -data");
    out.println("\nBtree levels: " + nLevels);
    private int calcInSize(int nodeMax,
                   int nodeAvg,
                   int keySize,
                   boolean lsnCompression) {
    /* Fixed overhead */
    int size = MemoryBudget.IN_FIXED_OVERHEAD;
    /* Byte state array plus keys and nodes arrays */
    size += MemoryBudget.byteArraySize(nodeMax) +
    (nodeMax * (2 * MemoryBudget.ARRAY_ITEM_OVERHEAD));
    /* LSN array */
         if (lsnCompression) {
         size += MemoryBudget.byteArraySize(nodeMax * 2);
         } else {
         size += MemoryBudget.BYTE_ARRAY_OVERHEAD +
    (nodeMax * MemoryBudget.LONG_OVERHEAD);
    /* Keys for populated entries plus the identifier key */
    size += (nodeAvg + 1) * MemoryBudget.byteArraySize(keySize);
    return size;
    private int calcLnSize(int dataSize) {
    return MemoryBudget.LN_OVERHEAD +
    MemoryBudget.byteArraySize(dataSize);
    private long calculateOverhead(long btreeSize, long overhead) {
    long cacheSize;
    if (overhead == 0) {
    cacheSize = (100 * btreeSize) / 90;
    } else {
    cacheSize = btreeSize + overhead;
         return cacheSize;
    private String line(long btreeSize,
                   long cacheSize,
                   String comment) {
    StringBuffer buf = new StringBuffer(100);
    column(buf, INT_FORMAT.format(cacheSize));
    column(buf, INT_FORMAT.format(btreeSize));
    column(buf, comment);
    return buf.toString();
    private void column(StringBuffer buf, String str) {
    int start = buf.length();
    while (buf.length() - start + str.length() < COLUMN_WIDTH) {
    buf.append(' ');
    buf.append(str);
    for (int i = 0; i < COLUMN_SEPARATOR; i += 1) {
    buf.append(' ');
    private static void measure(PrintStream out,
    File dir,
    long records,
    int keySize,
    int dataSize,
    int nodeMax,
    boolean randomKeys)
    throws DatabaseException {
    String[] fileNames = dir.list();
    if (fileNames != null && fileNames.length > 0) {
    usage("Directory is not empty: " + dir);
    Environment env = openEnvironment(dir, true);
    Database db = openDatabase(env, nodeMax, true);
    try {
    out.println("\nMeasuring with cache size: " +
    INT_FORMAT.format(env.getConfig().getCacheSize()));
    insertRecords(out, env, db, records, keySize, dataSize, randomKeys);
    printStats(out, env,
    "Stats for internal and leaf nodes (after insert)");
    db.close();
    env.close();
    env = openEnvironment(dir, false);
    db = openDatabase(env, nodeMax, false);
    out.println("\nPreloading with cache size: " +
    INT_FORMAT.format(env.getConfig().getCacheSize()));
    preloadRecords(out, db);
    printStats(out, env,
    "Stats for internal nodes only (after preload)");
    } finally {
    try {
    db.close();
    env.close();
    } catch (Exception e) {
    out.println("During close: " + e);
    private static Environment openEnvironment(File dir, boolean allowCreate)
    throws DatabaseException {
    EnvironmentConfig envConfig = new EnvironmentConfig();
    envConfig.setAllowCreate(allowCreate);
    envConfig.setCachePercent(90);
    return new Environment(dir, envConfig);
    private static Database openDatabase(Environment env, int nodeMax,
    boolean allowCreate)
    throws DatabaseException {
    DatabaseConfig dbConfig = new DatabaseConfig();
    dbConfig.setAllowCreate(allowCreate);
    dbConfig.setNodeMaxEntries(nodeMax);
    return env.openDatabase(null, "foo", dbConfig);
    private static void insertRecords(PrintStream out,
    Environment env,
    Database db,
    long records,
    int keySize,
    int dataSize,
    boolean randomKeys)
    throws DatabaseException {
    DatabaseEntry key = new DatabaseEntry();
    DatabaseEntry data = new DatabaseEntry(new byte[dataSize]);
    BigInteger bigInt = BigInteger.ZERO;
    Random rnd = new Random(123);
    for (int i = 0; i < records; i += 1) {
    if (randomKeys) {
    byte[] a = new byte[keySize];
    rnd.nextBytes(a);
    key.setData(a);
    } else {
    bigInt = bigInt.add(BigInteger.ONE);
    byte[] a = bigInt.toByteArray();
    if (a.length < keySize) {
    byte[] a2 = new byte[keySize];
    System.arraycopy(a, 0, a2, a2.length - a.length, a.length);
    a = a2;
    } else if (a.length > keySize) {
    out.println("*** Key doesn't fit value=" + bigInt +
    " byte length=" + a.length);
    return;
    key.setData(a);
    OperationStatus status = db.putNoOverwrite(null, key, data);
    if (status == OperationStatus.KEYEXIST && randomKeys) {
    i -= 1;
    out.println("Random key already exists -- retrying");
    continue;
    if (status != OperationStatus.SUCCESS) {
    out.println("*** " + status);
    return;
    if (i % 10000 == 0) {
    EnvironmentStats stats = env.getStats(null);
    if (stats.getNNodesScanned() > 0) {
    out.println("*** Ran out of cache memory at record " + i +
    " -- try increasing the Java heap size ***");
    return;
    out.print(".");
    out.flush();
    private static void preloadRecords(final PrintStream out,
    final Database db)
    throws DatabaseException {
    Thread thread = new Thread() {
    public void run() {
    while (true) {
    try {
    out.print(".");
    out.flush();
    Thread.sleep(5 * 1000);
    } catch (InterruptedException e) {
    break;
    thread.start();
    db.preload(0);
    thread.interrupt();
    try {
    thread.join();
    } catch (InterruptedException e) {
    e.printStackTrace(out);
    private static void printStats(PrintStream out,
    Environment env,
    String msg)
    throws DatabaseException {
    out.println();
    out.println(msg + ':');
    EnvironmentStats stats = env.getStats(null);
    out.println("CacheSize=" +
    INT_FORMAT.format(stats.getCacheTotalBytes()) +
    " BtreeSize=" +
    INT_FORMAT.format(stats.getCacheDataBytes()));
    if (stats.getNNodesScanned() > 0) {
    out.println("*** All records did not fit in the cache ***");

  • SQL pricing for Migrating an existing multi-tenant application

    We have a client with an ~10 year old multi-tenant application running on a traditional dedicated hosting environment.  The client is interested in migrating to Azure but only if they can benefit from PAAS features (managed backups, snapshots, scaling,
    etc).
    Their application automatically creates a new SQL database with each new customer signup.  As such, there are 886 databases which would need to be moved.  The total size on disk of all DBs together is only 3.82 GB.  Only 3 DBs are more than
    100 MB.  862 of the DBs are less than 10MB each (794 of those are less than 5MB).
    The way I read Azure pricing, each of these 883 DBs less than 100 GB would cost $5/month.  The only other alternative is to get a VM with SQL server on it -- but I can't see the advantage of that vs. the dedicated host they are already using.
    Is there any other alternative to consider when contemplating an application made up of many small databases?
    Thanks in advance for any advice,
    Jason

    Hi,
    If you have existing applications or workloads you simply want to grab and move to the cloud, SQL Server in a Virtual Machine is the easiest path to realize the benefits of the cloud. If you are looking to innovate and build new relational applications running
    in the cloud or extend parts of on-premises applications into the cloud, SQL Database is the best long-term solution.
    In your scenario, if use azure SQL, you must pay for each database per month, refer to
    http://azure.microsoft.com/en-us/pricing/details/sql-database/for more information about SQL Azure, cost too much.
    About use SQL VM, I suggest you read the following article.
     #http://blogs.msdn.com/b/windowsazure/archive/2013/06/04/the-top-10-things-to-know-when-running-sql-server-workloads-on-windows-azure-virtual-machines.aspx?Redirected=true
    Best Regards
    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.

  • How to Install BAM Alerts in multi environment in 2013 R2? How to point to a single BAM Portal(Default WebSite) configured on BTS APP server1 from BTS App Server 2 and BTS App Server 3 ?

    Please guide me on BAM install in multi environment for 2013 R2. Any blog which can show, how to configure multiple BTS servers to point to a single BAM portal created on the first server.
    The BAM portal is configured on the Default Website on the first server.
    How Could I Point to the same portal while configuring other 2 BTS servers?
    What are the authentication mechanisms, I have to use at virtual directories and root level?
    Racha Rams

    The document for installing BAM for B2K13 in a multi-computer environment is available as part of the BizTalk documentation available for download from
    http://www.microsoft.com/en-in/download/details.aspx?id=35552
    You will most likely also need to refer to the TechNet Blog
    http://blogs.technet.com/b/meamcs/archive/2013/07/26/fixed-biztalk-2013-bam-tools-configuration-problem.aspx which mentions having to setup SQL Mail feature in SQL Server 2012 and post that configuring both the features BAM Tools and BAM Alerts together.
    Regards.

  • Maintaining default locale in multi-lingual application

    Hello,
    I have a multi-lingual application where the language can be changed at runtime.
    To make the following code work properly, the default locale has to be set each
    time the language changes. Why?
    Since I need to check sometimes the platforms original locale (I do this with
    "Locale.getDefault()"), I am looking for a way not to change the default locale,
    but still to change the resourceBundle.
    In the API I read under "ResourceBundle, Cache Management" that the bundles are cached. Is this the reason why redefining the resourceBundle has no effect? And if yes, how can it be avoided?
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    public class Y extends JFrame {
      boolean toggle;
      Locale currentLocale;
      JButton b;
      ResourceBundle languageBundle;
      String country, userLanguage;
      public Y() {
        setSize(300,300);
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        Container cp= getContentPane();
        b= new JButton();
        b.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
         toggle= !toggle;
         if (toggle)
           country= "DE";
         else
           country= "GB";
         setUserLanguage(country);
        cp.add(b, BorderLayout.SOUTH);
        setUserLanguage("GB");
        setVisible(true);
      public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
          public void run() {
         new Y();
      void setUserLanguage(String country) {
        if (country.equals("DE"))
          userLanguage= "de";
        else
          userLanguage= "en";
        currentLocale = new Locale(userLanguage, country);
    //    System.out.println(currentLocale); // The locale changes ...
    //    Locale.setDefault(currentLocale); // Remove comment slashes and it works.
    //    languageBundle.clearCache(); // No effect.
        languageBundle = ResourceBundle.getBundle("MyBundle",currentLocale);
        System.out.println(languageBundle); // ... but the resourceBundle does not change.
        b.setText(languageBundle.getString("ButtonText"));
    The resource bundle files:
    MyBundle.properties
    ButtonText= Just a button
    MyBundle_de_DE.properties
    ButtonText= Nur ein KnopfEdited by: Joerg22 on 18.08.2008 13:26

    What's your default locale? If your default locale is de_DE, that's the expected behavior. The reason for it is the fallback mechanism searches default locale's bundle before falls back to the base bundle, i.e., in case of searching en_GB bundle, the search order is:
    en_GB
    en
    de_DE
    de
    (base)
    So, it will choose MyBundles_de_DE.
    If you do not want this default locale fallback, you can specify ResourceBundle.Control instance, which is returned from ResourceBundle.Control.getNoFallbackControl() method, in your getBundle() call. Or if you do not use JDK6, you could copy the base bundle to MyBundles_en, which is ugly but should work.
    Naoto
    Edited by: naoto on Aug 18, 2008 1:05 PM

  • Multi-entity application

    Hi there,
    I'm developing a multi-entity application and I'm not sure how to optimize the data base. Let say big tables for each entity will have 15000 rows per year and we are expecting at least 150 entities, so we are talking about 2250000 rows per year. It´s a web application and we want an optimized response, there are complicated queries with a lot of JOINS so we did some test and it´s a bit slow.
    well, we thought in two options:
    1.- a column in each table to indicate the entity: tables with 2250000 rows each year.
    2.- each entity connects with a different oracle user wich contains its own tables (big ones): 15000 rows per year but 150 users.
    I asked about this, someone told me that 150 users wouldn't be efficent becouse oracle would spend too many memory to manage it (I dont know).
    Any answer will be welcome
    Thanks!
    PD: sorry about my english, I´m spanish ;-)

    So, wouldn´t you suggestuse a different user for each entity?
    Imagine you have 10 tables, 5 of them have around 15000 rows per year and there will be 150 entities like that. we thoght of using a different user for each one just for the eavy tables, and keep the rest of tables in a common schema. So the entity A access with the user A (all the schemas have synonims to the common schema).
    Ah, It´s a web app.

  • Multi Currency application

    Hi All.
    I have created a multi currency application with only two currencies USD and Euro. But when i try to enter the data into the data forms through USD or Euro, i am not able to do that.
    But when i select local then it allows me to enter the data. I never created a local member and its not their in the dimension, so what is the significance of this local currency.
    Also, i created some currency conversion scripts and run them successfully but when i see data across Euro or USD it is the same data i entered into the local currency.
    Please guide as I am very confused.

    Have a read of this post :- Re: Read/Write functionality in Planning Data Forms
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Multi-Thread application and common data

    I try to make a multi-Thread application. All the Threads will update some common data.
    How could I access the variable �VALUE� with the Thread in the following code:
    public class Demo {
    private static long VALUE;
    public Demo(long SvId) {
    VALUE = 0;
    public static class makeThread extends Thread {
    public void run() {
    VALUE++;
    public static long getVALUE() {
    return VALUE;
    The goal is to get the �VALUE� updated by the Thread with �getVALUE()�
    Thanks for your reply
    Benoit

    That code is so wrong in so many ways......
    I know you're just experimenting here, learning what can and can't be done with Threads, but bad habits start early, and get harder to kick as time goes on. I am going to give a little explanation here about what's wrong, and what's right.. If you're going to do anything serious though, please, read some books, and don't pick up bad habits.
    Alright, The "answer" code. You don't use Thread.sleep() to wait for Threads to finish. That's just silly, use the join() method. It blocks until the threads execution is done. So if you have a whole bunch of threads in an array, and you want to start them up, and then do something once they finish. Do this.
    for(int k=0; k<threads.length; k++) {
      threads[k].start();
    for(int k=0; k<threads.length; k++) {
      threads[k].join();
    System.out.println("All Threads Done");Now that's the simple problem. No tears there.
    On to the java memory model. Here where the eye water starts flowing. The program you have written is not guarenteed to do what you expect it to do, that is, increment VALUE some amount of time and then print it out. The program is not "Thread Safe".
    Problem 1) - Atomic Operations and Synchronization
    Incrementing a 'long' is not an atomic operation via the JVM spec, icrementing an int is, so if you change the type of VALUE to an int you don't have to worry about corruption here. If a long is required, or any method with more then one operation that must complete without another thread entering. Then you must learn how to use the synchronized keyword.
    Problem 2) - Visiblity
    To get at this problem you have to understand low level computing terms. The variable VALUE will NOT be written out to main memory every time you increment it. It will be stored in the CPUs cache. If you have more then one CPU, and different CPUs get those threads you are starting up, one CPU won't know what the other is doing. You get memory overwrites, and nothing you expect. If you solve problem 1 by using a synchronized block, you also solve problem 2, because updating a variable under a lock will cause full visiblity of the change. However, there is another keyword in java.. "volatile".. A field modified with this keyword will always have it's changes visible.
    This is a very short explaination, barely scratching the surface. I won't even go into performance issues here. If you want to know more. Here's the resources.
    Doug Lea's book
    http://java.sun.com/docs/books/cp/
    Doug Lea's Site
    http://g.cs.oswego.edu
    -Spinoza

  • Jdev11g: Has anyone developed a multi -langual application successfully?

    Hi,
    In our application the user can change the language of the application by selecting it from as drop-down-list.
    This works fine if we run the application with embedded WLS.
    But running it on external WLS the language switch does not have any effect.
    We have already filled bug 7588599 for this issue which is also reproduceable from Oracle Support.
    At the moment I do not know a workaround.
    I can't believe that there is nobody out there who has already been successfull with a multi-langual application on external WLS?
    I hope to find a workaround in this forum to avoid waiting for backport patch.
    regards
    Peter
    Edited by: hofespet on Nov 26, 2008 7:18 AM
    repost

    Hi,
    problem is solved!
    Excerpt from the SR:
    Development did find the cause of the problem. The framework does lookup the language files in a specific format. That is the language must be in lower case and not in uppercase. In this case the file system is case insensitive since it is windows, so the exploded app just happened to work since it was finding the file on the file system. When deploying the application the file is being looked up by the jar/zip-finder which is working case-sensitive and thus it cannot find the file "startBundle_en.properties".
    The application should name the resource files exactly how they will be looked up by the application and by the ResourceBundleManagerRT.
    Rename the file "startBundle_EN.properties" into "startBundle_en.properties".
    regards
    Peter

  • Multi user application control data access

    Dear all,
    i am using Oracle Developer Suite 10g and database 10g, windows xp plate form.
    i want to develop multi user application regarding education.
    i have two questions.
    1. i take a start from creating an HR database which have 30 tables.
    this database has 10 users.
    the users will log on from their own schema.
    how they will access the HR schema?
    should i create a public synonym for each table in the HR Schema?
    or should i create a view for each table in each user schema?
    or should i grant select,insert,update etc to each user on HR schema?
    2. i want to control the data access for each user.
    i.e. every student could access his own academic record. each teacher access his own related record, the manager the owner and so on.
    how to accompolish this task? oracle roles are not sufficient for this purpose.
    Your help is highly appriciated.

    How about you start with the basic stuff, like the 2 days developers guide:
    http://www.oracle.com/pls/db112/to_toc?pathname=appdev.112/e10766/toc.htm
    and make it to the advanced developers guide:
    http://docs.oracle.com/cd/E11882_01/appdev.112/e25518/toc.htm
    and work your way through the concepts manual:
    http://www.oracle.com/pls/db112/to_toc?pathname=server.112/e25789/toc.htm
    and everything else which sounds interesting to you in here:
    http://www.oracle.com/pls/db112/portal.portal_db?selected=5&frame=
    As for your first question this should be covered here:
    http://docs.oracle.com/cd/E11882_01/network.112/e16543/authorization.htm#BABHFJFJ
    i want to control the data access for each user.This is also documented:
    http://docs.oracle.com/cd/E11882_01/network.112/e16543/vpd.htm#CIHBAJGI
    cheers

  • Immutable Objects in multi threaded application - how does it works?

    Hi
    I have this code will work in multithreaded application.
    I know that immutable object is thread safe because its state cannot be changed. And if we have volatile reference, if is changed with e.g.
    MyImmutableObject state = MyImmutableObject.newInstance(oldState, newArgs); i.e. if a thread wants to update the state it must create new immutable object initializing it with the old state and some new state arguments) and this will be visible to all other threads.
    But the question is, if a thread2 starts long operation with the state, in the middle of which thread1 updates the state with new instance, what will happen? Thread2 will use reference to the old object state i.e. it will use inconsistent state? Or thread2 will see the change made by thread1 because the reference to state is volatile, and in this case thread1 can use in the first part of its long operation the old state and in the second part the new state, which is incorrect?
    Therad1:                                                  Thead2:
    State state = cache.get();     //t1                  
    Result result1 = DoSomethingWithState(state);     //t1    
                               State state = cache.get(); //t2
       ->longOperation1(state); //t1
                               Result result2 = DoSomethingWithState(state); //t2
                                   ->longOperation1(state); //t2
       ->longOperation2(state);//t1
    cache.update(result1);    //t1             
                                   ->longOperation2(state);//t2
                               cache.update(result2);//t2
    Result DoSomethingWithState(State state) {
       longOperation1(state);
       //Imaging Thread1 finish here and update state, when Thread2 is going to execute next method
       longOperation2(state);
    return result;
    class cache {
    private volatile State state = State.newInstance(null, null);
    cache.update(result) {
       this.state = State.newInstance(result.getState, result.getNewFactors);
    get(){
    return state;
    }

    Please don't cross post
    http://stackoverflow.com/questions/6803487/immutable-objects-in-multi-threaded-application-how-does-it-work

  • Clarification of the handle/body idiom in multi threaded applications

    Hello
    As some DBXML classes use the handle-body idiom (handle/body idiom in some docs), could someone please clarify the consequences of that in a multi threaded application like a web container?
    For 100% Java people, like me, this is known in the Java world as 'programming towards interfaces', or as the Bridge pattern; which is seen as good practice.
    Let's take an example. The class XmlQueryContext is not thread safe, but it has a copy constructor. Imagine that your web application has one XmlQueryContext, that we never use in a query, but that we prepare only to be copied in new threads. Is it thus safe to instantiate various new XmlQueryContexts using that copy constructor in various new threads and use them simultaneously?
    Thank you
    Koen
    PS What I am really asking here is if somebody could please translate the following to Java parlé:
    A copy constructor is provided for this class. The class is implemented using a handle-body idiom. When a handle is copied both handles maintain a reference to the same body.

    As a Java user you do not have to worry about how the C++ copy constructors behave. In the Java API if a copy constructor exists for the object, then the copy constructor will copy all of the original object's data into a new object (XmlContainer is the one exception to this rule, generally one should not use that copy constructor at all). So in short, what you plan to do will work.
    Lauren Foutz

  • Is JSF fitted to build a multi-views application?

    Hello,
    I'm looking for technologies to build a new Web application and investigating JSF, but I need experienced advices to make my mind if JSF is fitted with this type of application.
    This application will use a MVC model, but instead of a simple HTML view, it'll have multiple views. The majority of these will be HTML pages, but not only. A view can be selected on a request parameter or client detection, or even on the application setup.
    The multiple views are used mainly for:
    - localization when the languages supported have an impact on the layout of the page.
    - customization of the application by customers, when light solutions based on CSS or parameterization is not enough.
    - support for different clients, probably based on user agent detection.
    At first, I thought going the classical path, with servlets or Struts with a XSLT filter, but this solution suffers of:
    - XSL is not simple, and finding Web designers fluent with this technology is hard.
    - Why reinvent the wheel with servlets when MVC framework have matured (I particularly like JSF actions workflow)?
    With the planned number of different views, frequently changing or adding new onews, what I seems to need is JSF with views defined as templates, something like incorporating Tapestry and Cocoon ideas. But from what I've read on JSF, it seems to me to be too much HTML oriented (just look at the structure of the tags or the use of JSP pages), even if I can develop other RenderKits.
    Do you think JSF could be adapted for this kind of application? Do you have any technologies advices?

    With no response to my question, what should I conclude:
    - No one has developped such multi-views applications...
    - No one has gained enough experience with JSF to answer...
    - This question is already answered in a FAQ somwhere...
    - This is not the correct way to support strong localization of a Web application. You won't dare answer such a basic question...
    - Your management doesn't allow you to share your experience with JSF...
    - {Pick a randow excuse and copy it there}

  • Multi-Channel Application

    The following error occurs when trying to execute a multi channel application in Openwave 6.2:
    Request timed out.

    Could you provide more details? What platform and version of o9iASW Wireless are you using? The latest version should also support xhtml pages.
    Rgds,
    Thomas

  • Multi-form applications

    I have a created a multi-form application where i have a calling form which calls another form. The user could commit changes in the called form and return to the calling form and either have changes in that form committed or rolled back. However, a commit in the called form SHOULD NOT commit any changes in the calling form. All this works fine.
    I have implemented this using "autonomous transaction". I am using the call_form --> open_form sequence for this purpose. i.e there is a call to a dummy form using call_form and this dummy form calls the other form using open_form call. Now, the problem that i have is that, at times the called form gets hidden behind the calling form and what is visible to the user is the calling form - with no access to any items on the form as this form is now NOT the active form in the application. This problem, though not reproducible has occurred many times. I do not have a solution to this. Any suggestions/pointers/soultions most welcome.
    Thanks in advance..

    What are OPEN_FORM,CALL_FORM,NEW_FORM? diff?
    CALL_FORM : It calls the other form. but parent remains active, when called form completes the operation , it releases lock and control goes back to the calling form.
    When you call a form, Oracle Forms issues a savepoint for the called form. If the CLEAR_FORM function causes a rollback when the called form is current, Oracle Forms rolls back uncommitted changes to this savepoint.
    OPEN_FORM : When you call a form, Oracle Forms issues a savepoint for the called form. If the CLEAR_FORM function causes a rollback when the called form is current, Oracle Forms rolls back uncommitted changes to this savepoint.
    NEW_FORM : Exits the current form and enters the indicated form. The calling form is terminated as the parent form. If the calling form had been called by a higher form, Oracle Forms keeps the higher call active and treats it as a call to the new form. Oracle Forms releases memory (such as database cursors) that the terminated form was using.
    Oracle Forms runs the new form with the same Runform options as the parent form. If the parent form was a called form, Oracle Forms runs the new form with the same options as the parent form.
    Call_form.
    BEGIN
    CALL_FORM('FORM2',
    NO_HIDE,
    DO_REPLACE, -- replace menu
    NO_QUERY_ONLY,
    SHARE_LIBRARY_DATA);
    END;
    Syntax
    OPEN_FORM(form_name);
    OPEN_FORM(form_name,activate_mode);
    OPEN_FORM(form_name,activate_mode,session_mode);
    OPEN_FORM(form_name,activate_mode,session_mode,
    paramlist_name);
    OPEN_FORM(form_name,activate_mode,session_mode,
    paramlist_id);
    sarah

Maybe you are looking for