Posts

Showing posts with the label mysql

How liferay is identifying the database configuration

In liferay we configure the database configuration properties in the portal-ext.properties. So when we restart the server or during server startup , we can see the log as  Determine dialect for MYSQL5 or if it is orcale  Determine dialect for oracle 11g . so how liferay is identifying? In Liferay have a look in to the  DialectDetector class and the method  getDialect(DataSource dataSource) . Look into the following code in the method. Connection connection = dataSource.getConnection(); DatabaseMetaData databaseMetaData = connection.getMetaData(); String dbName = databaseMetaData.getDatabaseProductName(); int dbMajorVersion = databaseMetaData.getDatabaseMajorVersion(); dialectKey = dbName.concat(StringPool.COLON).concat( String.valueOf(dbMajorVersion)); dialect = _dialects.get(dialectKey); if (_log.isInfoEnabled()) { _log.info("Determine dialect for " + dbName + " " + dbMajorVersion); } else if (dbName.startsWith("Oracle") &...

Difference between InnoDB and MyISAM in MySQL?

InnoDB : is a storage engine for MySQL. MyISAM : is the default storage engine for the MySQL relational database management system versions prior to 5.5 1. The major deficiency of MyISAM is the absence of transactions support . Versions of MySQL 5.5 and greater have switched to the InnoDB engine to ensure referential integrity constraints, and higher concurrency. Ensure that your database supports transactions; yes ! this is needless to say but then if you are using MySQL, the database engine other MyISAM does not support transactions. You must use InnoDB as the database engine for your tables.