Showing posts with label database. Show all posts
Showing posts with label database. Show all posts

Thursday, June 18, 2009

I run my Tomcat, instead I get this "ORACLE DATABASE 10g EXPRESS..." message

You try to run  Apache Tomcat, but instead you  get this message "ORACLE DATABASE 10g EXPRESS EDITION LICENSE AGREEMENT".
This simply means
If you bump into this problem, you have an Oracle 10g Express Edition (OracleXE 10g) installation sitting on the same port as your Tomcat default port (TCP/IP port 8080). As the TCP/IP protocol doesn't allow you to have more than one process listening to the same port (except when you use the advanced channel/selector), then when you start Tomcat, it will fail. You might not be aware that your Tomcat has failed to start, until you get into that message mentioned above.

There are 2 cures to this symptoms, the first cure  is to let Oracle XE take the port, and we move the tomcat installation to another port. The second cure is to set the Oracle XE to use another port.

To achieve the first one, you need to modify your $CATALINA_HOME/conf/server.xml file. Find the portion of the file that contains this snippet (assuming you are using the standard Tomcat installation):

[sourcecode lang="xml"]
connectionTimeout="20000"
redirectPort="8443" />
[/sourcecode]

Change the port 8080 to something else, e.g. 8484.

[sourcecode lang="xml"]
connectionTimeout="20000"
redirectPort="8443" />
[/sourcecode]

By now you should be able to run you application.
Don't forget that you have to run it from port 8484. So if the application you deploy is someapp.war the URL that you aim should be http://localhost:8484/someapp/ instead of http://localhost:8080/someapp/

Ok, now if you want to take the second cure, go to your Oracle XE 10g console using sqlplus. Replace mypassword with that your SYS user password (as specified during the installation process). Note that the number 2, 3, 4 at the left side is generated by the sqlplus tools prompt (you don't need to type them in).

[sourcecode lang="sql"]
C:\> sqlplus sys/mypassword@xe as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jun 18 17:53:47 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production

SQL> begin
2 dbms_xdb.sethttpport('8484');
3 end;
4 /
[/sourcecode]

Oracle XE should reply:

[sourcecode lang="sql"]
PL/SQL procedure successfully completed.
[/sourcecode]

After that check to ensure that the configuration has been changed properly:

[sourcecode lang="sql"]
SQL> select dbms_xdb.gethttpport as "HTTP-Port is " from dual;
[/sourcecode]

You should get a message like this:

[sourcecode lang="sql"]
HTTP-Port is
------------
8484
[/sourcecode]

Exit from sqlplus by typing "exit" at the prompt.

If everything as expected, now you can start the Tomcat server and use the port 8080 for Tomcat. To access the Oracle XE 10g database web console, access through http://localhost:8484/apex

Wednesday, July 25, 2007

What is an XA driver?

XA is a set of distributed transaction protocols defined by Open Group.
XA provide interfaces that could be used for cross platform transactions. Currently, much of the famous databases provided XA-compliant drivers. XA-compliant driver means that the transaction manager could send XA command directly to the driver.
Oops, sorry, in the world of distributed transaction, there are transaction manager and resource managers. Transaction manager coordinate the transaction, orchestrating the two-phase commit for each of the resource manager.
In JEE point of view, and transaction manager could be a type 3 JDBC driver, and the resource managers could be an XA compliant JDBC drivers, or general type 4 JDBC driver in which the type 3 JDBC driver will emulate XA command using common JDBC transaction commands.
In WebLogic console, when we setup a connection pool, usually we will be asked whether we want to assign an XA driver or just ordinary driver. XA drivers will have a significant overhead imposed into it, so make sure you only use the XA drivers when really required. It is common to have an XA-compliant version of connection pool and non-XA-compliant connection pool, both connecting to the same database, to avoid performance penalty when we don't need two-phase commit.
In my former company, we have a clustered WebLogic server installation with each of the databases have two pairs of connection pools, a non-XA and XA-compliant driver. Due to clustered environment, database connection are using RMI through JNDI lookup. For read only data, always use non-XA connection pool to increase performance.

Wednesday, March 28, 2007

Oracle Acquired Tangosol

Last year it was TimesTen and SleepyCat (BerkeleyDB).
This year it is Tangosol.
Who will be the next?

This database giant acquired Tangosol (vendor of Coherence data cache which has been used in many large financials), adding to its "Extreme Transaction Processing" initiative.

http://go.techtarget.com/r/1194471/5981609
http://www.oracle.com/tangosol/index.html