Skip to main content

Posts

Showing posts from December, 2010

Access multiple Databases in JPA

According to JPA specification we can define multiple "persistence-unit" elements (i.e. like below) in persistence.xml file and can easily refer them inside Dao layers as this. public class PolarDaoImpl {     @PersistenceContext(unitName="PolarPU")     protected EntityManager entityManager; -- } public class BearDaoImpl {     @PersistenceContext(unitName="BearPU")     protected EntityManager entityManager; -- } Checkout sample persistence.xml <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">     <!-- Database 1 -->     <persistence-unit name="PolarPU" transaction-type="RESOURCE_LOCAL">        ...

Two point formula for Apple IPhone to outsell Android ?

Introduce multiple Iphones with a basic one costing around $100 so Carriers can give it for free in US, and in rest of the world most people can afford it, this can be very slim like IPod without any camera and special hardware, so regular user can enjoy web and touch screen. Introduce and Advertise more Geeky themes which young men would like, this is where Android is making inroad. This is for free -- Do something about Java on IPhone like how Google cleverly used it. 

Running Liferay in Development Mode

Liferay speeds up rendering UI pages including Portlets by caching CSS, JS and layout files, this make developing portlets little painful, since every time you make js or css changes in your portlet and deploy. you may have to clear temp, work directoires and clear caches from Liferay control panel. So when using Liferay for development we can switch off the caching by adding few properties to "portal-ext.properties" file, this will save some time and frustation when developing portlets Solution 1 :  Copy all values from portal-developer.properties to portal-ext.properties Solution 2 :  Copy below values to portal-ext.properties, portal-ext.properties location - webapps/ROOT/WEB-INF/classes/portal-ext.properties if not present create a new one theme.css.fast.load=false theme.images.fast.load=false javascript.fast.load=true javascript.log.enabled=true layout.template.cache.enabled=false browser.launcher.url= combo.check.timestamp=true freemarker...