Multiple Database in J2ee Application

Dear sirs,
I have a J2ee application which is running in JBOSS Server. The Data tier is MySql.
Now the scenario is like this,
We are having two clients, and the clients have different sub users. The clients are using two seperate database for the same application. Now the application is working in two different servers assigned for each clients. Now we are planning to integrate it to a single application . I would like to know whether
1. Is it possible to specify the JNDI names for more than one database in the deployement descriptor?
2. if it is then, how can we instruct the container to lookup dynamically for the appropriate database based on the user logged in to the application .
I am planning to setup a new DB for the users information sothat the container can select the appropriate DB based on the user logged in...
Thankyou,
Sudheesh K S,

Did you setup multiple realms correctly?
Steps to follow (depending on your version of OID):
- define second realm (OIDDAS)
- Reconfigure SSO (login.jsp)
- enable hosting (wwhost script)
- add second subscriber (addsub script)
- change searchbase (OIDDAS/ldif)
All documented in the Oracle® Internet Directory Administrator's Guide,
10g Release 2 (10.1.2) at
http://download-west.oracle.com/docs/cd/B14099_19/idmanage.1012/b14082/toc.htm
Pay attention to chapter 7 and appendix G

Similar Messages

  • Cannot use multiple database in my application

    I have written a C++/CLI wrapper for use berkeleydb without lost performance. This wrapper run perfectly with one database but when i open a second database ( i create a new instance of the wrapper ) the application crash.
    I have written a minimal pure C++ application that use the pure C++ classe of my wrapper, when a open and use only one database the code run perfectly but with two databases, the application be crazy.
    infos : compiler VC++ 2008, OS : Vista 32bit
    this the code of my berkeleydb class :
    #pragma comment (lib, "libdb47.lib")
    #if defined(WIN32) || defined(WIN64)
    #include <windows.h>
    #include <list>
    #endif
    #ifndef ParamsStructCpp
    #include "ParamsStruct.h"
    #endif
    #include <db_cxx.h>
    #include "BerkeleyMethods.h"
    using namespace std;
    using namespace stdext;
    // type
    //typedef list<ParamsStructCpp>::iterator it;
    typedef list<ParamsStructCpp> fetchbuffer;
    // Db objects
    Db * db; // Database object
    DbEnv env(0); // Environment for transaction
    u_int32_t oFlags = DB_CREATE|DB_AUTO_COMMIT|DB_READ_UNCOMMITTED; // Open flags; //
    u_int32_t env_oFlags = DB_CREATE |
    DB_THREAD |
                             DB_INIT_LOCK |
                             DB_INIT_LOG |
                             DB_INIT_MPOOL |
                             DB_INIT_TXN |
                             DB_MULTIVERSION; // Flags for environement
    // Constructeurs
    BerkeleyMethods::BerkeleyMethods()
    BerkeleyMethods::BerkeleyMethods(char * dbname, unsigned int db_cache_gbyte, unsigned int db_cache_size,
                        int db_cache_number, int db_type, char * dberr_file, char * envdir, unsigned int dbtxn_timeout,
                             unsigned int dbtxn_max)
         strcpy_s(this->db_name, strlen(_db_name)+1, dbname);
         this->db_cache_gbyte = db_cache_gbyte;
    this->db_cache_size = db_cache_size;
         this->db_cache_number = db_cache_number;
    this->db_type = db_type;
         this->db_txn_timeout = dbtxn_timeout;
         this->db_txn_max = dbtxn_max;
         strcpy_s(this->db_err_file, strlen(_db_err_file)+1, dberr_file);
         strcpy_s(this->env_dir, strlen(_env_dir)+1, envdir);
         this->Set_restoremode(false);
    // ==========
    // Fonctions
    // http://www.codeproject.com/KB/string/UtfConverter.aspx
    bool BerkeleyMethods::OpenDatabase()
         try
              std::cout << "Dbname " << this->db_name << std::endl;
              if (strlen(this->db_name) < 2) {
    throw new std::exception("Database name is unset");
              // Set database cache
              env.set_cachesize(this->db_cache_gbyte, this->db_cache_size, this->db_cache_number);
              // Set transaction timeout
              if (this->db_txn_timeout > 0) {
                   env.set_timeout(this->db_txn_timeout, DB_SET_TXN_TIMEOUT);
    // Set max opened transactions
              if (this->db_txn_max > 0) {
                   env.set_tx_max(this->db_txn_max);
              // Dupplicate key support;
              if (this->Get_dup_support()) {
    env_oFlags = env_oFlags|DB_DUPSORT;
              // Deadlokcs gesture
              env.set_lk_detect(DB_LOCK_MINWRITE);
    // Set the error file
              env.set_errfile(fopen(this->db_err_file, "w+"));
    // Error prefix
              env.set_errpfx("Error > ");
              // Open environement
              env.open(this->env_dir, env_oFlags, 0);
              // Create database object
              db = new Db(&env, 0);
              // Open the database
              switch(this->db_type)
              case 1:
                   db->open(NULL, this->db_name, NULL, DB_BTREE, oFlags, 0);
                   break;
              case 2:
                   db->open(NULL, this->db_name, NULL, DB_HASH, oFlags, 0);
                   break;
              case 3:
                   db->open(NULL, this->db_name, NULL, DB_QUEUE, oFlags, 0);
                   break;
              case 4:
                   db->open(NULL, this->db_name, NULL, DB_RECNO, oFlags, 0);
                   break;
              default:
                   throw new std::exception("Database name is unset");
                   break;
              u_int32_t gbcacheSize = 0;
    u_int32_t bytecacheSize=0;
    int ncache=0;
    env.get_cachesize(&gbcacheSize,&bytecacheSize,&ncache);
    std::cerr << "Taille du cache est:" << gbcacheSize << "Go plus " << bytecacheSize << " octets." << std::endl;
    std::cerr << "Number of caches : " << ncache << std::endl;
              return true;
         catch(DbException &e)
              std::cout << e.what() << std::endl;
         catch(std::exception &e)
              std::cout << e.what() << std::endl;
         return false;
    bool BerkeleyMethods::CloseDatabase()
         try
              db->close(0);
              env.close(0);
              return true;
         catch(DbException &e)
              std::cout << e.what() << std::endl;
         catch(std::exception &e)
              std::cout << e.what() << std::endl;
         return false;
    bool BerkeleyMethods::AddData(char * key, unsigned long int value)
         if (this->Get_restoremode())
              return false;
         DbTxn * txn;
         try
              env.txn_begin(NULL, &txn, 0); // Bebin transaction
              // Set datas
    Dbt _key(key, strlen(key)+1);
    Dbt _value(&value, sizeof(unsigned long int));
              env.txn_checkpoint(512, 2, 0);
              int exist = db->put(txn, &_key, &_value, DB_NOOVERWRITE);
              if (exist == DB_KEYEXIST) {
                   std::cout << "This record already exist" << std::endl;
              txn->commit(0);
              return true;
         catch(DbException &e)
              std::cout << e.what() << std::endl;
              txn->abort();
         catch(...)
              std::cout << "Error" << std::endl;
              txn->abort();
         return false;
    bool BerkeleyMethods::AddData(unsigned long int key, char * value)
         if (this->Get_restoremode())
              return false;
         DbTxn * txn;
         try
              env.txn_begin(NULL, &txn, 0); // Bebin transaction
    Dbt _key(&key, sizeof(unsigned long int));
              Dbt _value(value, strlen(value)+1);
              env.txn_checkpoint(512, 2, 0);
              int exist = db->put(txn, &_key, &_value, DB_NOOVERWRITE);
              if (exist == DB_KEYEXIST) {
                   std::cout << "This record already exist" << std::endl;
              txn->commit(0);     
              return true;
         catch(DbException &e)
              std::cout << e.what() << std::endl;
              txn->abort();
         catch(...)
              txn->abort();
         return false;
    bool BerkeleyMethods::AddData(char * key, char * value)
         if (this->Get_restoremode())
              return false;
         DbTxn * txn;
         try
              env.txn_begin(NULL, &txn, 0); // Bebin transaction
    Dbt _key(key, strlen(key)+1);
              Dbt _value(value, strlen(value)+1);
              env.txn_checkpoint(512, 2, 0);
              int exist = db->put(txn, &_key, &_value, DB_NOOVERWRITE);
              if (exist == DB_KEYEXIST) {
                   std::cout << "This record already exist" << std::endl;
              txn->commit(0);     
              return true;
         catch(DbException &e)
              std::cout << e.what() << std::endl;
              txn->abort();
         catch(...)
              txn->abort();
         return false;
    bool BerkeleyMethods::AddData(unsigned long int key, unsigned long int value)
         if (this->Get_restoremode())
              return false;
         DbTxn * txn;
         try
              env.txn_begin(NULL, &txn, 0); // Bebin transaction
    Dbt _key(&key, sizeof(unsigned long int));
              Dbt _value(&value, sizeof(unsigned long int));
              env.txn_checkpoint(512, 2, 0);
              int exist = db->put(txn, &_key, &_value, DB_NOOVERWRITE);
              if (exist == DB_KEYEXIST) {
                   std::cout << "This record already exist" << std::endl;
              txn->commit(0);     
              return true;
         catch(DbException &e)
              std::cout << e.what() << std::endl;
              txn->abort();
         catch(...)
              txn->abort();
         return false;
    bool BerkeleyMethods::AddData(char * key, ParamsStructCpp value)
         if (this->Get_restoremode())
              return false;
         DbTxn * txn;
         try
              env.txn_begin(NULL, &txn, 0); // Bebin transaction
    Dbt _key(key, strlen(key)+1);
              Dbt _value(&value, sizeof(ParamsStructCpp));
              env.txn_checkpoint(512, 2, 0);
              int exist = db->put(txn, &_key, &_value, DB_NOOVERWRITE);
              if (exist == DB_KEYEXIST) {
                   std::cout << "This record already exist" << std::endl;
              txn->commit(0);     
              return true;
         catch(DbException &e)
              std::cout << e.what() << std::endl;
              txn->abort();
         catch(...)
              txn->abort();
         return false;
    bool BerkeleyMethods::AddData(unsigned long int key, struct ParamsStructCpp value)
         if (this->Get_restoremode())
              return false;
         DbTxn * txn;
         try
              env.txn_begin(NULL, &txn, 0); // Bebin transaction
    Dbt _key(&key, sizeof(unsigned long int));
              Dbt _value(&value, sizeof(ParamsStructCpp));
              env.txn_checkpoint(512, 2, 0);
              int exist = db->put(txn, &_key, &_value, DB_NOOVERWRITE);
              if (exist == DB_KEYEXIST) {
                   std::cout << "This record already exist" << std::endl;
              txn->commit(0);     
              return true;
         catch(DbException &e)
              std::cout << e.what() << std::endl;
              txn->abort();
         catch(...)
              txn->abort();
         return false;
    bool BerkeleyMethods::Exist(unsigned long int key)
         if (this->Get_restoremode())
              return true;
         DbTxn * txn;
         try
              env.txn_begin(NULL, &txn, DB_TXN_SNAPSHOT); // Bebin transaction
    Dbt _key(&key, sizeof(unsigned long int));
              int state = db->exists(txn, &_key, DB_READ_COMMITTED);
              txn->commit(0);
              if (state == 0) {
                   return true;
         catch(DbException &e)
              std::cout << e.what() << std::endl;
              txn->abort();
         catch(...)
              txn->abort();
         return false;
    bool BerkeleyMethods::Exist(char * key)
         if (this->Get_restoremode())
              return true;
         DbTxn * txn;
         try
              env.txn_begin(NULL, &txn, DB_TXN_SNAPSHOT); // Bebin transaction
              Dbt _key(key, strlen(key)+1);
              int state = db->exists(txn, &_key,DB_READ_COMMITTED);
              txn->commit(0);
              if (state == 0) {
                   return true;
         catch(DbException &e)
              std::cout << e.what() << std::endl;
              txn->abort();
         catch(...)
              txn->abort();
         return false;
    void BerkeleyMethods::GetData (char * pData, int nbr, unsigned long int key)
         if (this->Get_restoremode())
              return;
         DbTxn * txn;
         Dbc *dbcp;
         try
    env.txn_begin(NULL, &txn, DB_TXN_SNAPSHOT); // Bebin transaction
              db->cursor(txn, &dbcp, 0);
              Dbt _key;
              Dbt data;
              key.setdata(&key);
              key.setsize(sizeof(unsigned long int));
              dbcp->get(&_key, &data, DB_FIRST);
              char * temp = (char *)data.get_data();
    strcpy_s(pData, strlen(temp)+1, temp);
              dbcp->close();
              txn->commit(0);
         catch(DbException &e)
              std::cout << e.what() << std::endl;
              if (dbcp != NULL)
                   dbcp->close();
              if (txn != NULL)
                   txn->abort();
         catch(...)
              if (dbcp != NULL)
                   dbcp->close();
              if (txn != NULL)
                   txn->abort();
    unsigned long int BerkeleyMethods::GetData(char * key)
         if (this->Get_restoremode())
              return 0;
         DbTxn * txn;
         Dbc *dbcp;
         try
    env.txn_begin(NULL, &txn, DB_TXN_SNAPSHOT); // Bebin transaction
              db->cursor(txn, &dbcp, 0);
    Dbt _key;
              Dbt data;
              key.setdata(key);
              key.setulen(strlen(key)+1);
              dbcp->get(&_key, &data, DB_FIRST);
    unsigned long int xdata = *((unsigned long int *)data.get_data());
              dbcp->close();
              txn->commit(0);
              return xdata;
         catch(DbException &e)
              std::cout << e.what() << std::endl;
              dbcp->close();
              txn->abort();
         catch(...)
              dbcp->close();
              txn->abort();
         return 0;
    ParamsStructCpp * BerkeleyMethods::GetData(unsigned long int key, bool null)
         if (this->Get_restoremode()) {
              return new ParamsStructCpp();
         DbTxn * txn;
         Dbc *dbcp;
         try
    env.txn_begin(NULL, &txn, DB_TXN_SNAPSHOT); // Bebin transaction
              db->cursor(txn, &dbcp, 0);
              Dbt _key;
              Dbt data;
              key.setdata(&key);
              key.setsize(sizeof(unsigned long int));
    dbcp->get(&_key, &data, DB_FIRST);
              ParamsStructCpp * temp = (ParamsStructCpp *)data.get_data();
              dbcp->close();
              txn->commit(0);
              return temp;
         catch(DbException &e)
              std::cout << e.what() << std::endl;
              dbcp->close();
              txn->abort();
         catch(...)
              dbcp->close();
              txn->abort();
         return new ParamsStructCpp();
    ParamsStructCpp * BerkeleyMethods::GetData(char * key, bool null)
         if (this->Get_restoremode()) {
              return new ParamsStructCpp();
         DbTxn * txn;
         Dbc *dbcp;
         try
    env.txn_begin(NULL, &txn, DB_TXN_SNAPSHOT); // Bebin transaction
              db->cursor(txn, &dbcp, 0);
    Dbt _key;
              Dbt data;
              key.setdata(key);
              key.setulen(strlen(key)+1);
              dbcp->get(&_key, &data, DB_FIRST);
    ParamsStructCpp * xdata = (ParamsStructCpp *)data.get_data();
              dbcp->close();
              txn->commit(0);
              return xdata;
         catch(DbException &e)
              std::cout << e.what() << std::endl;
              dbcp->close();
              txn->abort();
         catch(...)
              dbcp->close();
              txn->abort();
         return new ParamsStructCpp();
    list<ParamsStruct> BerkeleyMethods::FetchAllDatabase ()
         list<ParamsStruct> temp;
         Dbc *dbcp;
         try
              db->cursor(NULL, &dbcp, 0);
    Dbt _key;
              Dbt data;
    while(dbcp->get(&_key, &data, DB_NEXT))
                   unsigned long int key = *((unsigned long int *)_key.get_data());
                   char * datetime = (char *)data.get_data();
                   ParamsStruct p;
                   strcpy_s(p.lastaccess, strlen(datetime)+1, datetime);
                   p.downloaded
                   temp.push_back(
                   //temp.insert(Tuple(datetime, key));
         catch(DbException &e)
              std::cout << e.what() << std::endl;
         catch(...)
         return temp;
    bool BerkeleyMethods::DeleteData(unsigned long int key)
         if (this->Get_restoremode())
              return true;
         DbTxn * txn;
         try
              env.txn_checkpoint(128, 1, 0);
              env.txn_begin(NULL, &txn, 0); // Bebin transaction
    Dbt _key;
              key.setdata(&key);
              key.setsize(sizeof(unsigned long int));
              db->del(txn, &_key, 0);
              txn->commit(0);
              return true;
         catch(DbException &e)
              std::cout << e.what() << std::endl;
              txn->abort();
         catch(...)
              txn->abort();
         return false;;
    bool BerkeleyMethods::DeleteData(char * key)
         if (this->Get_restoremode())
              return true;
         DbTxn * txn;
         try
              env.txn_begin(NULL, &txn, 0); // Bebin transaction
    Dbt _key;
              key.setdata(key);
              key.setulen(strlen(key)+1);
              db->del(txn, &_key, 0);
              txn->commit(0);
              return true;
         catch(DbException &e)
              std::cout << e.what() << std::endl;
              txn->abort();
         catch(...)
              txn->abort();
         return false;
    int BerkeleyMethods::Sync()
         if (this->Get_restoremode())
              return -1;
         try
              return db->sync(0);
         catch(...)
    return -1;
    int BerkeleyMethods::Count()
         if (this->Get_restoremode())
              return -1;
         Dbc *dbcp;
         int count = 0;
         try
    Dbt key;
              Dbt data;
              db->cursor(NULL, &dbcp, 0);
              while (dbcp->get(&key, &data, DB_NEXT) == 0) {
    count++;
              dbcp->close();
              return count;
         catch(...)
    return -1;
    BerkeleyMethods::~BerkeleyMethods()
         if (db) {
         db->sync(0);
    db->close(0);
         env.close(0);
    =====
    The code the use this class :
         BerkeleyMethods db("test.db", 0, 524288000, 1, 1, "log.txt", "./Env_dir", 1000000 * 5, 600000);
                   BerkeleyMethods db1("test2.db", 0, 524288000, 1, 1, "log2.txt", "./Env_dir2", 1000000 * 5, 600000);
    bool z = db.OpenDatabase();
    db1.OpenDatabase();
    if (z)
                        std::cout << "Base de données ouverte" << std::endl;
                   for (unsigned int i = 0; i < 1000; i++)
                        ParamsStructCpp p = { 10, "02/08/2008 14:46:23", 789 };
                   bool a = db.AddData(i, p);
                        db1.AddData(i, p);
    if (a)
                        std::cout << "Ajout de données ok" << std::endl;
                   for (unsigned int i = 0; i < 1000; i++)
                        ParamsStructCpp * c = db.GetData(i, false);
                        ParamsStructCpp * c1 = db1.GetData(i, false);
                        std::cout << "Donné récupéré " << c->downloaded << " : " << c->lastaccess << " : " << c->waittime << std::endl;
                        std::cout << "Donné récupéré " << c1->downloaded << " : " << c1->lastaccess << " : " << c1->waittime << std::endl;
    / ====
    The application output show that when using two database the data is not correctly set. It seems that db and db1 is the same object :|.
    For example in db i insert a key => toto with value 4, and in db1 i insert the same value nomaly have no problem. But berkeleydb say the the key toto in db1 already exist while not
    I don't understand.
    NB : sorry for my english

    Michael Cahill wrote:
    As a side note, it is unlikely that you want both
    DB_READ_UNCOMMITTED and DB_MULTIVERSION to be set.
    This combination pays a price during updates for
    maintaining multiple versions, but still requires
    (short term) locks to be held during reads. The BDB/XML Transaction Processing Guide states the following:
    [...]in addition to BDB XML's normal degrees of isolation, you can also use snapshot isolation. This allows you to avoid the read locks that serializable isolation requires.
    http://www.oracle.com/technology/documentation/berkeley-db/xml/gsg_xml_txn/cxx/isolation.html
    This seems to contradict what you're saying here.
    Is there a general guideline on whether or not to use MVCC together with a relaxed isolation degree like DB_READ_UNCOMMITTED? Should the statement in the BDB/XML TP Guide rather have "as an alternative to" instead of "in addition to"?
    Michael Ludwig

  • Multiple databases in one application with locations unknown

    Hello everyone,
    I am developing an application that uses several databases, one database for each user. The users, and the parameters for their database connections, are read from a configuration-file at runtime.
    I would like to use JPA to access the databases. This is where the problem arises, because if I try to get an EntityManagerFactory, I have to specify a name; I just use <username>-pu. This causes a PersistenceException because "No Persistence provider for EntityManager named maarten-pu". Which is correct, because my persistence.xml contains no persistence units.
    I cannot define all persistence units beforehand, because at that time the configuration-file is not yet read.
    Does anyone know how to solve this problem?
    Kind regards, and thanks in advance,
    Maarten

    Hello everyone,
    I am developing an application that uses several databases, one database for each user. The users, and the parameters for their database connections, are read from a configuration-file at runtime.
    I would like to use JPA to access the databases. This is where the problem arises, because if I try to get an EntityManagerFactory, I have to specify a name; I just use <username>-pu. This causes a PersistenceException because "No Persistence provider for EntityManager named maarten-pu". Which is correct, because my persistence.xml contains no persistence units.
    I cannot define all persistence units beforehand, because at that time the configuration-file is not yet read.
    Does anyone know how to solve this problem?
    Kind regards, and thanks in advance,
    Maarten

  • How can I send a message from database to a J2EE application?

    How can I send a message from database to a J2EE application?
    If I have a codetable in database that has new or modified values I have to refresh the codetable in my J2EE application.
    Most effective way would be send a message to initiate a table reload from J2EE app, but I don't know how to do this.
    Now I have a background thread that regular reads the table and looks for changes.

    http://www.oracle.com/technology/products/integration/bam/10.1.3/TechNotes/TechNote_BAM_AQ_Configuration.pdf
    This document details how to create triggers on a table that send out JMS messages.
    In this example, the messages are going to Oracle BAM.. your message could go to your J2EE application listening to its own topic/queue.
    an alternative idea.
    you could also just cache your lookup table with something like Oracle Coherence and than try to ensure that all changes to the lookup go through Coherence, so that you won't need to do notification from the db up to the application. the application and the lookup data management tool would be using the data grid for management of the lookup table data, and the data grid (coherence) would persist the lookup data changes back to the db.

  • Multiple database in the same ADF application

    In my application I have to access a legacy database, in addition to the main database. How do I handle multiple database connections. Do I need to manage the JDBC connection to the legacy database myself.
    Pranab

    Use an AM for each dataconnection and then share the AMs so then can see each others datamodels.
    Or you can use jdbc in your code to access the databases.
    If would be nice if the adf had a way to connect to any data source set up in the configuration and app server on the fly.

  • Application that connects to multiple databases.

    I am developing an application that performs many task, but one in particular is connecting to multiple databases and creating user accounts in each all with the push of a single button. I have tried putting connect statements in the trigger code but I don't get the desired results.
    How would I get my application to switch database connections while in execution?
    Please reply to the forum, or email me @ [email protected]
    Thank you.
    Travis

    Hi
    The only possible way which I could find for your requirement is that of DB Links. Establish DataBase Links among the multible databases, with which you want to work in one session. Peform all your actions through the DB Links.

  • One Application Multiple Databases

    Hello Friends,
    I am developing application using Struts and Hibernate. I is a web application. Now i want to do one functionality that is some what like..
    Suppose "My_Appp" is my application. I have 1,2,3,4 clients or users. Now I want to maintain seperate database for an individual user. Suppose 1 login's he will be directed to his database and when 2 login's he will be directed to his own database but I want to deploy Only and Only one .war file for all the Users. Means One Interface and Multiple databases. Is this possible using Hibenate and Struts. I anybody know, Please help me?
    Thanks and Regards
    Dagadu Akambe
    Pune, India

    I wouldn't recommend this. Why wouldn't you try to put a 'user' table to the database and let user xy only work on his entities?
    The other solution would be, using different aliases, but imo this has the same nasty effect.
    The only way using more than one database is, imo, if different data is stored in different databases.
    I'm sorry this post isn't answering your questions, but there is surely an easier solution.
    reagards
    slowfly

  • Can we link one application instance with multiple databases ?

    We have R12.1.1 and db is 11.1.0.7 on redhat 5.3 ( 64 bit).
    Can we link one application instance ( apps / , inst / ) with multiple database ( db / ),
    is this possible ?
    if yes how ?

    >
    Can we link one application instance ( apps / , inst / ) with multiple database ( db / ),
    is this possible ?
    No. You cant link application tier with more than one database.
    Similar query already answered by Hussein in detail in the forum :Re: Multiple instances, single Apps tier Please check that for more details
    -Rk

  • Multiple J2EE applications on iAS904

    Hi,
    We will be having lots of J2EE applications deploy on iAS904. Is the best practice for this to have 1 OC4J per J2EE application? Or all J2EE applications in one OC4J container?
    Thanks,
    Charles

    Hi Charles --
    It's difficult to provide a single best practice. You'll need to look at the pros/cons of each and decide what makes most sense for your environment:
    To get the ball rolling, here are some considerations:
    1 OC4J instance per app:
    + finer grained manageability -- you can make changes to the one app which may require a start/stop of the app or the instance, which won't have any effect on other running apps/OC4J instances
    + The container level log files will just contain information pertaining to that one specific application
    + The OC4J instances can be tuned specifically for the application -- ie JVM settings
    + Clustering can be targetted for the single app -- if you have multiple applications per OC4J instance, then they all will participate in clustering if it is enabled (and they are clusterable). One app per OC4J instance produces a finer grained cluster model.
    - Each OC4J instance is a JVM process. If each app has a JVM process then you may be wasting resouces on the system as the apps aren't sharing a JVM
    - More management operations may be required since you may need to configure/maintain more instance information
    I'm sure some other folks will chime in here with some more insight on their practical experiences.
    There's an Oracle Application Server Best Practices document on OTN which I seem to remember does have some coverage of management/deployment issues which may some more information for you to consider.
    cheers
    -steve-

  • Best practice for distributing/releasing J2EE applications.

    Hi All,
    We are developing a J2EE application and would like some information on the best
    practices to be followed for distributing/releasing J2EE applications, in general.
    In particular, the dilemma we have is centered around the generation of stub, skeleton
    and additional classes for the application.
    Most App. Servers can generate the required classes while deploying the EJBs in the
    application i.e. at install time. While some ( BEA Weblogic and IBM Websphere are
    two that we are aware of ) allow these classes to be generated before the installation
    time and the .ear file containing the additional classes is the one that is uploaded.
    For instance, say we have assembled the application "myapp.ear" . There are two ways
    in which the classes can be generated. The first is using 'ejbc' ( assume we are
    using BEA Weblogic ), which generates the stub, skeleton and additional classes for
    the application and returns the file, say, "Deployable_myapp.ear" containing all
    the necessary classes and files. This file is the one that is then installed. The
    other option is to install the file "myapp.ear" and let the Weblogic App. server
    itself, generate the required classes at the installation time.
    If the first way, of 'pre-generating' the stubs is followed, does it require us to
    separately generate the stubs for each versions of the App. Server that we support
    ? i.e. if we generate a deployable file having the required classes using the 'ejbc'
    of Weblogic Ver5.1, can the same file be installed on Weblogic Ver6.1 or do we
    have to generate a separate file?
    If the second method, of 'install-time-generation' of stubs is used, what is the
    nature/magnitude of the risk that we are taking in terms of the failure of the installation
    Any links to useful resources as well as comments/suggestions will be appreciated.
    TIA
    Regards,
    Aasif

    Its much easier to distribute schema/data from an older version to a newer one than the other way around. Nearly all SQL Server deployment features supports database version upgrade, and these include the "Copy Database" wizard, BACKUP/RESTORE,
    detach/attach, script generation, Microsoft Sync framework, and a few others.
    EVEN if you just want to distribute schemas, you may want to distribute the entire database, and then truncate the tables to purge data.
    Backing up and restoring your database is by far the most RELIABLE method of distributing it, but it may not be pratical in some cases because you'll need to generate a new backup every time a schema change occurs, but not if you already have an automated
    backup/maintenance routine in your environment.
    As an alternative, you can Copy Database functionality in SSMS, although it may present itself unstable in some situations, specially if you are distributing across multiple subnets and/or domains. It will also require you to purge data if/when applicable.
    Another option is to detach your database, copy its files, and then attach them in both the source and destination instances. It will generate downtime for your detached databases, so there are better methods for distribution available.
    And then there is the previously mentioned method of generating scripts for schema, and then using an INSERT statement or the import data wizard available in SSMS (which is very practical and implements a SSIS package internally that can be saved for repeated
    executions). Works fine, not as practical as the other options, but is the best way for distributing databases when their version is being downgraded.
    With all this said, there is no "best practice" for this. There are multiple features, each offering their own advantages and downfalls which allow them to align to different business requirements.

  • Unable to connect to the OracleForms application through a J2EE application

    Hi there,
    I have deployed a custom J2EE application in Middleware instance of my Oracle 10g AS 10.1.2
    The application is sso enabled . Once a user logs in the application he is able to see a jsp in which i display hyperlinks for him to access.
    One of these hyperlinks is pointing to the forms application.
    the url is http://psc-pc0592:7778/forms/frmservlet?config=abs_deploy[b]
    Once i click on the URL the forms applet begins to load but as the applet opens up i get the database logon screen.This should not happen
    I am already logged and have been verified by sso.
    Also the forms configuration is associated with a datasource.
    I am not able to get as to why i get that screen when it shoud directly connect to the forms application.
    Any help on this is appreciated.
    Thanks & Regards,
    Madhur Pant

    when you go through your carrier provider, there is an additional step in the SSL tunnel. Not sure how this transcribes, but it is possible that your carrier does not use the same port as the one you want it to use.
    The search box on top-right of this page is your true friend, and the public Knowledge Base too:

  • Using SSO to connect to database from J2EE

    I have an SSO enabled J2EE application and an SSO enabled database and I can connect to both of these applicatins using the single sign-on account.
    What I want to know is
    How do you get a J2EE application to connect to the database with the already connected SSO credentials?
    I am using Oracle 10g for both the app server and database
    Any help will be gratefully received.

    Hello,
    Also we have a simple how-to about database proxy authentication in the OC4J 10.1.3 How-tos page (see How-To Configure and Use Proxy-authentication with Data Sources ).
    Regards
    Tugdual Grall

  • Is anyone doing disaster recovery for a J2EE application?

    We generally use database log shipping to maintain a standby database for our ABAP instances.  We can successfully fail over our production application to our disaster recovery site with no real issues.  With the J2EE instances (EP, ESS/MSS, BI, etc), we have a few concerns:
    hostname cannot change, without going through a system copy procedure, so we would have to keep the hostnames in DR the same. (for example, ref: oss note 757692 - changing hostname is not supported)
    fully qualified domain name - from what I understand, there are potentially issues with changing the fqdn, for example SSO certificates, BSPs, XI has issues, etc.
    we can't keep both hostname and fqdn the same between DR and production, or we could never do a DR test.
    Has anyone implemented disaster recovery for any SAP J2EE application that has run into these concerns and addressed them?  Input would be greatly appreciated regarding how you addressed these issues, or how you architected your disaster recovery implementation.
    Regards,
    David Hull
    The Walt Disney Company

    I haven't done this personally, but I do have some experience with these issues in different HA environments.
    To your first point:  You can change the hostname, note 757692 tells you exactly how to do it.  However like the note says, "Changing the name of a host server in a production system is not automatically supported by SAP."  When it says "supported by SAP" I think it means SAP the company, not SAP's software.  So I would contact SAP to see if this configuration would be covered under your service agreement.  Then you have to think about whether you want to do something that isn't "officially supported" by SAP.  Also I'm sure you'll need some kind of additional licensing for the DR systems as their hardware keys will de different.
    To your second point:  As for SSO certs (SAP Login Tickets), I think they should still work as long as the SID and client number of the issuing system remain the same.  I don't think they are hostname or fqdn dependant.  For BSPs I would think they would still work as long as they use relative paths rather than absolute paths.  And for XI... I have no idea what kind of issues may arise, I'm not an XI guy.
    Again, I haven't done what you're describing myself.  This is just based on my HA experiences.
    Hope this helps a little,
    Glenn

  • Multiple Database access in a single transaction

    Hello All,
    I have read in a book which states that "according to J2ee Specification,a single transaction(an EJB method for example) may not be provided access to multiple JDBC resource providers.."
    Does it mean that i cannot access multiple databases from different vendors in a single EJB transaction??
    Any help is very much appreciated
    Thanks

    Hello Sebastien,
    Thanks for your response!!!
    Let me make it bit more clear.In deploymewnt descriptor,we define jndi name for any resource and do a lookup on that resource from the code.
    Let us consider that resource as JDBC data source for our discussion.usually you define any jdbc data source under a JDBC resource provider.
    So my question is,in a single transaction can you access multiple data sources defines under multiple JDBC resource providers.
    Ex:A datasource "x "defined under resource provider "A"[say DB2 jbdc provider] and a datasource "y" defined under respurce provider "B"[say mysql jdbc provider].
    Thanks

  • Multiple Database Instances on Single Server and effect of NLS_LANG

    What is the effect of the NLS_LANG registry setting on a Windows server that is to host multiple database instance each created with a different database character set ? The server needs to support data in the following languages : Thai, Chinese Traditional, Chinese Simplified, Vietnamese and Korean. Selecting the Unicode character set(AL32UTF8) is not an option since the application is not Unicode complaint.
    My understanding is that as long as NLS_LANG is set correctly on the client connecting to the particular database instance then the data will be stored correctly - is this correct ?
    What should NLS_LANG be set to on the server if there are multiple oracle instances with different character sets ?

    My question is not in relation to connecting to the database on the server itself but with regards to client connections. What I need to know is what is the effect of the NLS_LANG setting in the registry on a server that has multiple databases each created with a different character set ?
    Say for instance, the server has two databases - one created with the character set ZHS16GBK and the other created with the character set JA16SJIS and NLS_LANG is set to SIMPLIFIED CHINESE_CHINA.ZHS16GBK in the registry on the server. Will Japanese data that is inserted into the database that has character set JA16SJIS be stored correctly when it is inserted from a client with NLS_LANG set to JAPANESE_JAPAN.JA16SJIS even though NLS_LANG is set to SIMPLIFIED CHINESE_CHINA.ZHS16GBK on the server ?

Maybe you are looking for

  • Why don't gif animations work in Mail 3.4?

    I posted this earlier today on what I thought was the 10.5 Leopard section and as it turned out, it somehow posted in the Panther OS section. Doh! I'm sorry if you saw the other post and this is the second time you have read this today. I have read t

  • How to custom a conversion error in JSF page in JDeveloper

    According to the book "Core JavaServer Faces" p213 (fifth edition), if I add the following line to messages.properties file, and specifiy it in the faces-config.xml and .jsp file, then the displayed conversion error message should be my tailored one

  • How to disable message images in Mail app for all but contacts?

    I use the Mail app for OS X Mavericks and have been inundated with spam lately. I understand that spam email campaigns can confirm that you have opened their mail (and subsequently continue to send you mail) by image tracking so I would like to disab

  • Group not resizing correctly when contents are moved programmatically

    Hi there, My apologies in advance if this is a known issue. I searched the forums but I was unable to find a discussion about this topic. The issue we are running into is when we programmatically move the contents of a Group which is in turn enclosed

  • Can't switch email back?

    I have my phone protected under the Geek Squad replacement warranty. In order to send your phone in, you need to turn off Find My iPhone. Since my screen was broken to the point where it couldn't be used, I had to use iCloud.com. The verification ema