掲示板

Restore Database connectivity without restarting your liferay server

thumbnail
13年前 に sunita satpathy によって更新されました。

Restore Database connectivity without restarting your liferay server

New Member 投稿: 14 参加年月日: 10/02/18 最新の投稿
Hi,

When I start my Liferay server, if the database connectivity is nit available, it throws sql io exception and need to be restarted after the database server is restarted.
But I need that after the database is restored , liferay will detect the connection and start working without restarting.

I have implemented the same for my java application , where in the startup servlet, I retry for establishing the database connectivity in every 2 mins until the database is up and it is successful in establishing the connection.

I want same for liferay, but not able to identify where I can implement this.

Can any one help me???
13年前 に Marek Wianecki によって更新されました。

RE: Restore Database connectivity without restarting your liferay server

New Member 投稿: 15 参加年月日: 10/05/10 最新の投稿
how did you configured database connection ? you should read Liferay configuration examples more carefully emoticon.
Try this (this is for mysql):
add to /opt/liferay/tomcat-6.0.18/conf/Catalina/localhost/ROOT.xml
<Resource
name="jdbc/LiferayPool"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://<your_db_hostname>:3306/<your_db_name>?useUnicode=true&amp;characterEncoding=UTF-8&amp;useFastDateParsing=false"
username="<dbusername>"
password="<dbuserpassword>"
maxActive="200"
maxIdle="50"
maxWait="10000"
/>
thumbnail
13年前 に sunita satpathy によって更新されました。

RE: Restore Database connectivity without restarting your liferay server

New Member 投稿: 14 参加年月日: 10/02/18 最新の投稿
I have defined my database connectivity in portal.properties file and as I am using JBOSS server, i have defined it on oracle-ds.xml.
This is my oracle-ds.xml.
<datasources>
<local-tx-datasource>
<jndi-name>OracleDS</jndi-name>
<connection-url>jdbc:oracle:thin:@172.18.225.180:1521:emundb</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>lportal</user-name>
<password>lportal</password>
<min-pool-size>20</min-pool-size>
<max-pool-size>100</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<metadata>
<type-mapping>Oracle10g</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>


Can you suggest any changes I can make to this.
Because my requirement is -If simultaneously I am restarting my Liferay and database, Liferay should keep on try for DB connection until the database is completely up.