Anandhan Subbiah - 'Inspire and Innovate' http://anandhansubbiah.com/blog Inspire and Innovate Thu, 01 May 2008 14:51:47 +0000 http://wordpress.org/?v=2.3.3 en Help Cows http://anandhansubbiah.com/blog/help-cows/ http://anandhansubbiah.com/blog/help-cows/#comments Tue, 29 Apr 2008 16:42:18 +0000 Anandhan Subbiah http://anandhansubbiah.com/blog/help-cows/ cow

By supporting PETA today, you can help reduce and end the suffering of more than 40 million cows—each a sensitive individual—who are killed in slaughterhouses in the United States each year.Most cows never enjoy a peaceful day in a grassy field.Instead, cows raised for their milk are commonly confined to filthy sheds and barren dirt lots. They’re hooked up to milking machines several times each day and are given hormones and antibiotics. They are repeatedly impregnated until their weak bodies finally give out. Then they are hauled on filthy trucks, sometimes hundreds of miles, to slaughterhouses. When they arrive, they are hung upside-down, dismembered, and skinned—sometimes while they are still conscious.

Cows on factory farms urgently need your help. One of the priorities of PETA’s factory farming campaign is to open the eyes—and hearts—of consumers to the suffering of these sensitive animals. Can I please count on your support to help us expose the cruelty inflicted on these suffering animals?

By making an online donation to PETA today, you will help sustain PETA’s vital investigations into milk and beef factory farms and slaughterhouses around the world. Thanks to our efforts—and your kind support—people are waking up to the horrific lives of suffering endured by cows and other animals killed for food.

People are learning that cows raised for their flesh bellow in pain as they are branded with hot fire irons, which inflict third-degree burns. They’re learning that cows’ horns are cut out of their skulls or are burned off and that male calves’ testicles are torn from their scrotums without any pain relief whatsoever.

The cows are shipped to massive, barren feed lots, and not all of them survive the journey. Next, they are fed an unnatural diet that can cause painful stomach ailments and sometimes fatal liver abscesses. The air is so full of ammonia, methane, and other noxious gases from the manure buildup that many cows have trouble breathing and develop severe respiratory problems.

Finally, at the end of their lives, the cows go on a frightening truck ride to their deaths. The only U.S. law that exists for the protection of farmed animals—the decades-old Humane Slaughter Act—is rarely enforced. While the law requires that cows be rendered unconscious before they are strung upside-down, the high-speed assembly line often fails to stun them, which means that many cows are skinned and dismembered while they are still conscious.

PETA has already won major animal welfare improvements at the world’s largest suppliers of pig and chicken flesh, but we’re still working nonstop to end such violence against cows and other animals. In order to win these battles, we need you to show your commitment to animals.

Please make a generous contribution to PETA right now and help us give cows the peace and cruelty-free lives that they deserve.

]]>
http://anandhansubbiah.com/blog/help-cows/feed/
Dasavatharam - Music Review http://anandhansubbiah.com/blog/dasavatharam-music-review/ http://anandhansubbiah.com/blog/dasavatharam-music-review/#comments Sat, 26 Apr 2008 02:48:59 +0000 Anandhan Subbiah http://anandhansubbiah.com/blog/dasavatharam-music-review/

Himesh Reshamiyya has performed the music score for a tamil movie for the first time. He is lucky that he is doing the score for a Kamal Hassan movie with a budget in excess of 35 crores.This is a typical Himesh album with high pitch vocals ,heavy bass and Keyboard generated sounds.

Ulaga Nayagan (Vinith)

A song patronizing the hero is sung by a new bee Vinith. Honestly I don’t know what to make of this song. It was neither good or bad but it did not leave a bad taste. The energy level for this kind of song is certainly missing.

Kalai Mattum (Hariharan)

Hariharan sings this song with his usual relish. The instrumentation suggests that this could be a song from the medieval period. The emphasis is more on the lyrics than the song itself even though I could not decipher the lyrics no matter how hard I tried . From whatever I understood this song could be opposing blind faith in God. The Arabic mix with the violin is interesting. This is possibly the best song of the album.

Oh Sanam (Kamal Hassan and Mahalakshmi Iyer)

This is a peppy song sung by Kamal himself. This is the only song I could hum after listening to the full album. Mahalakshmi supports him with her vocals and does a good job at it . The rhythm is decent and this is a typical Himesh song with the high pitch and heavy bass.

Mukunda Mukunda (Sadhana Sargam , Kamal Hassan)

This is a devotional song. It is very pleasing to the ear and definitely not bad but again it is not mind blowing either.I would have rated this song as best in the album but I was searching for the  next button in my remote towards the end when I was forced to hear a hideous voice. I can understand if this is a situational song but why on earth should I listen to such a horrible voice all of a sudden when I am listening to the awesome Sadhana Saragam ?

Kaa (Shalini Singh)

This song sounds like a disco song from the 80’s. It is fast paced and Shalini has done a decent job. I am assuming that this is a song for Mallika Sherawat. This song has a very nice pace and rhythm to it . I could not understand the lyrics for the most part but the song is at least peppy.

Oh Sanam (Himesh and Mahalakshmi Iyer)

This is a remix version of the song with the same title sung by Kamal Hassan. I will leave it with the fact that this is a remix and Himesh can pronounce tamil words better than Udit Narayan.

I am lost as to why Kamal did not go with the very talented music directors in the south. Rehman and Harris must have been busy but I think even the new music directors G.V Prakash or Joshua Sridhar would have done a better job than Himesh. I was not thrilled even with one of the songs even though I would not call any of them bad . Even in ‘Hey Ram’ there was one song which was mesmerizing even though the rest of the album was a damp squib. The expectation from a kamal Hassan movie  is very high and the budget of this movie requires a terrific music score but the compositions of  Himesh are way short of the high expectation. Maybe he recorded the songs when he was busy creating music for 10 movies in a day.

One of the issues could be that the the music was created two years ago but the bigger issue is it sounds like it is 10 years old.

I am just going to wait for the movie now.

]]>
http://anandhansubbiah.com/blog/dasavatharam-music-review/feed/
Norton 360 2.0 - it is 360 http://anandhansubbiah.com/blog/norton-360-20-it-is-360/ http://anandhansubbiah.com/blog/norton-360-20-it-is-360/#comments Thu, 24 Apr 2008 02:29:12 +0000 Anandhan Subbiah http://anandhansubbiah.com/blog/norton-360-20-it-is-360/ I wrote an article about Norton 360 a while back http://anandhansubbiah.com/blog/norton-360-not-compatible-with-norton-confindential/.

Someone in Symantec actually did make the changes that most of us were asking them to do. They have reintroduced the password manager as Identity Safe . This new program actually is actually a tool bar on both IE and Firefox. It will store passwords in a secure way and it also has the option to display the passwords in clear text. I was so mad that Symantec did not support this feature in their newer releases and I was very reluctant to use other applications .

One of the main issues if you are migrating from the password manger is that you cannot import the passwords and no other program other than the password manager can actually import the data exported from the software.Hopefully the symantec folks won’t make the same mistake and allow all future versions of Identify safe to be backward compatible .

These are the major features of Norton 360 2.0

  • Antivirus
  • Antispyware
  • Firewall
  • Intrusion Prevention
  • Vulnerability Assessment
  • Phishing Protection
  • Web Site Authentication
  • Background Scheduling of Scans and Backups
  • Password Encryption and Security
  • Local Backup (CD/DVD/External Drives)
  • Online Backup
  • Encryption of Backup Data
  • PC Defragmentation
  • PC Cleanup
  • Integrated Support
  • Single license supports up to 3 computers
  • Norton 360 also keeps PCs optimized and tuned for peak performance and protects the data on them by making it easy to back up photos, music, and financial records and restore them at any time. I really like the disk optimization and temp files cleanup feature.

    It works slightly different in Vista but the functionality is actually the same. The memory footprint is smaller than the previous version and it boots up a lot faster.

    Any company which listens to customer feedback and acts upon it deserves a pat in the back and symantec has earned that now.

    ]]>
    http://anandhansubbiah.com/blog/norton-360-20-it-is-360/feed/
    Kuruvi - Music review http://anandhansubbiah.com/blog/kuruvi-music-review/ http://anandhansubbiah.com/blog/kuruvi-music-review/#comments Mon, 21 Apr 2008 18:01:21 +0000 Anandhan Subbiah http://anandhansubbiah.com/blog/kuruvi-music-review/ Kuruvi

    Vidyasagar and Vijay have created many hits together and Kuruvi is no exception. It is a typical masala album which will please the fans of Vijay.Almost all the songs are fast paced and rhythmic .

    Happy New Year ( Sunidhi Chauhan, Yogi, Dr Burn)

    This is a Rap cum Kuthu song .It is a perfect start to the album and makes the intentions of the music director very obvious. Sunidhi Chauhan is the perfect choice and her heavy voice fits the song to a bill. Vidyasagar has experimented with his instrumentation and has come out a winner. The Kuthu beats have been used very differently and the rap mix in the middle is very catchy. Penned by Na Muthukumar, it has a pacy music with a lot of rhythm.

    Dandana Dara (Sangeeth Haldipur)

    A typical Kuthu song from Vidyasagar. The music director manages to sustain the momentum from start to finish. There is a nice rhythm to the song which makes it fun to listen to. Vijay is sure to set the stage on fire with this song.The only caveat is , this song reminds me of a song from Chandramukhi.

    Thaen Thaen (Udit Narayan, Shreya Ghosal)

    Shreya Ghosal is my favorite singer and she has done full justice to her talent in this song. Udit Naryan is average and just does what is expected of him. There is no doubt that he is one of the best singers in the industry but his hold of the language leaves a lot to be desired and I am still clueless as to why the music directors need him with the wealth of singers we have who can actually pronounce the words correctly. I am not trying to advocate that they have to pick regional singers; any singer from India should be able to sing anywhere in the country and I have no issue with Shreya Ghosal who is from North India but can sing the words properly. But to be really honest with all the regional divide that is going on in India it is better that we have this mix even if it sucks. Yugabharathy has handled the lyrics for this song. This soft and melodious number is the best song in the album.

    Paalaanadhu Paalaanadhu (Vidyasagar, Rajalakshmi)

    Heavy percussion instruments are Vidysagar’s forte and this song is no exception.The music director has also sung this song and he has not done a bad job.This song has it all for the discotheques and is sure to be a permanent resident in the clubs.Vijay has enough scope to show off his dancing abilities with such a versatile song.

    Mozha Mozhanu (KK , Anuradha Sreeram)

    A typical peppy song . There is nothing different or great about it . I was looking for the fast forward button halfway through the song.

    Theme Music

    I am not sure why the music director copied from Red Hot Chili peppers but he has enough originality in the song to claim it as his own . Heavy music is the order of the day and this song is no exception.

    You can listen to some of the the songs at Vidyasagar

    ]]>
    http://anandhansubbiah.com/blog/kuruvi-music-review/feed/
    Dham Dhoom - Music Review http://anandhansubbiah.com/blog/dham-dhoom-music-review/ http://anandhansubbiah.com/blog/dham-dhoom-music-review/#comments Sat, 19 Apr 2008 04:43:17 +0000 Anandhan Subbiah http://anandhansubbiah.com/blog/dham-dhoom-music-review/ Dham Dhoom

    Harris Jayaraj has performed the music for this movie directed by the late director Jeeva. Jeeva and Harris have worked together on big hits like 12B and “Unnale Unnale”. I think Harris prefers to reserve his best for certain directors and it is obvious Jeeva was one of them.

    Harris has not disappointed his fans at least not completely.Harris never seems to go outside of this comfort zone when creating music but he has the skill and the talent to create magic within his self imposed boundaries and this album is no exception.

    “Anbae Anbae” is a simple melody sung by Harish Ragahavendra and Prassana. It is a classy song and can easily fit into any “slow and melodious” play list .The lyrics are very decent The typical haunting interlude which is a trademark of Harris adds flavor to the song. Pay careful attention to the flute piece !

    “Dhiku Dhiku” sung by Benny and Sayanora is the fast song in the album and is very rhythmic. There is nothing much to say about this average song and will mostly prompt the user to press the next button in the remote.

    “Pudhu Pudhu” is refreshing and is sung by Benny , Guna and Suchithra. It has a rap mix and is a little different from a typical Harris composition. The tune and the lyrics are catchy and is a good song for the discos.There is a nice rock interlude in the middle .

    “Saghiyae” is the pick of the album and Harris at his best. The song sung by Krish and the “Harris Favorite ” Jayashree will grow on you. The song reminds me of an popular hit but is different enough to make it the best song of the album.

    “Uyilalo ” has a native flavor to it and is sung by Kailash Kher and Sujatha. I am not sure why Kailash was chosen but seems to be another Udit in the making .He kills the song with his bad Tamil rendition . Kailash is a awesome singer but he has to work a lot more on the language to be more successful .The song is yet another average song in the album and reminds me of the “Andan Kakka” song from Anniyan .

    “Aathiyilae” by Haricharan is a bit song but really managed to grab my attention. If you listen carefully it will remind you of the “Kanava” song from the tamil movie Ratchagan. Haricharan is awesome as usual and the lyrics are equally good. I would rate this as the second best song of the album.

    The album might grow on you but I was not thrilled .

    You can listen to the songs at http://anandhansubbiah.com/gallery/Songs/Harris/

    ]]>
    http://anandhansubbiah.com/blog/dham-dhoom-music-review/feed/
    Management Styles http://anandhansubbiah.com/blog/managemet-styles/ http://anandhansubbiah.com/blog/managemet-styles/#comments Mon, 14 Apr 2008 18:32:59 +0000 Anandhan Subbiah http://anandhansubbiah.com/blog/managemet-styles/ Google and Apple are in opposite ends of the spectrum in terms of management styles. Google allows the developers to innovate and Gmail and Google News emerged as the by products. Steve jobs rules Apple with a iron hand and we have seen the iphone and ipod make history. The founders of Hewlett Packard had a really different management style “management by walking”.It is really difficult to predict the best management style for a company and it is unique to each company in the way they operate and mostly a common sense approach is the order of the day. A management style which allows managed innovation and generates revenue and motivates employees to sustain them will be the best approach.

    A certain type of forcefulness and perseverance is sometimes helpful when tackling large, intractable problems,” says Roderick Kramer, a social psychologist at Stanford who wrote an appreciation of “great intimidators” — including Jobs — for the February 2006 Harvard Business Review. I believe strongly in this approach. Sometimes you can get the best out of people only if you apply pressure. Some of them may not be able to handle the pressure but then they deserve to get out of the corporate world.

    I believe that work is not the place to fool around ; you can innovate but there is a thin line between innovation and wasting valuable work time. It will be a mess if all the engineers think they have the perfect ideas to change the world. It is the job of the business to have plans to change the world and the engineers should support and execute on it. A good manager will have the ability to identify folks who can create and deliver at the same time but it will be extremely unhealthy if you have individuals who have a personal agenda which does not align with the business. In most cases it will backfire and the business has to incur a loss so the best thing to do is to to treat it like pollution and take steps to eradicate it.

    Trust is a key issue in almost all aspects of life and the work place is no exception. The engineers should be able to trust the product / business teams to be able to execute on the vision. Plain talk used to do the trick but not anymore. Accountability and a track record of success is very important. If the engineers know that too many decisions will not be tolerated and the product is closely managed in terms of reveneue and overall goals with a lot of transparency then there will it will be a lot easier to establish that trust.

    Accountability is a key factor. It does not mean that the individuals who are not able to deliver or make bad business /engineering choices should be fired but they should not be given more opportunities unless they improve. Instead someone who is more capable and a better track record should be given opportunities. Steps should also be taken to make sure mistakes don’t happen too often by setting up policies in place for review and audit.If there are too many mistakes and they are repetitive then the employees should be allowed to go else it might affect the overall business.

    I believe history can help you make decisions , if the company has not been able to deliver new cutting-edge products after a year of innovation time then that company is not suited to accommodate this. It does not matter if the business or the engineers are responsible but if a policy does not work then the best choice is to move forward and try other avenues.

    Budgets are another key aspect . I have seen companies lay off employees when things go wrong. I believe companies can do a lot more than taking the extreme step. A lot of money is wasted on software which is never used and large companies have a lot of hardware lying around which is never utilized. Buying a software with an expensive support plan without a proper usage plan is a nightmare most companies have to deal with. The best thing to do is have a clear audit policy. There should be a designated person analyzing and questioning these kind of requests. Before taking desperate measures it makes a lot of sense to limit internet bandwidth and telephone usage and limit anything else possible to save money. The company has to spend that much more money to get new employees and then train them on their applications before they can be useful.

    Management styles are changing in the web2.0 world Microsoft allows its engineers to blog. The CEO of Sun announces lay offs and major decisions via his blog. But no matter how different management styles are the rule is simple; employees have to work hard to make sure they support the business to improve and generate revenue. The business should make sure that they provide the vision and the platform for the employees to be productive. The employer has to make sure the employees who perform and have a track record of success are rewarded and encouraged .

    ]]>
    http://anandhansubbiah.com/blog/managemet-styles/feed/
    Do you know how pigs in the U.S. live their lives? http://anandhansubbiah.com/blog/do-you-know-how-pigs-in-the-us-live-their-lives/ http://anandhansubbiah.com/blog/do-you-know-how-pigs-in-the-us-live-their-lives/#comments Thu, 10 Apr 2008 02:11:20 +0000 Anandhan Subbiah http://anandhansubbiah.com/blog/do-you-know-how-pigs-in-the-us-live-their-lives/ Fact #1: In the U.S., more than 97 percent of pigs—smart, social, interesting animals—are raised on factory farms. They spend their entire lives in cramped, filthy warehouses, where they never see the sun or breathe fresh air. Because of their hideous living conditions, more than 70 percent of the pigs have pneumonia by the time they are kicked and prodded onto trucks bound for slaughterhouses. As piglets, they are ripped away from their mothers when they are less than 1 month old and dosed with antibiotics, and they have their tails, teeth, and testicles cut off—all without any pain relief. But even that’s not all that they go through.Breeding sows are imprisoned (there’s really no other word for it) in metal gestation crates so small that they can’t even turn around or take a single step—many develop painful sores and bruises from being immobilized on a hard surface. Shortly after giving birth, they are forcibly impregnated again. This cycle continues for years until their bodies finally give out and the animals are sent to slaughter. After enduring these hellish conditions for years, squealing pigs are poked, kicked, and dragged onto trucks so that they can be sent to slaughter.

    Fact #2: It doesn’t have to be this way. PETA is taking on the world’s biggest pork producers and reducing the abuse of these poor animals. Your urgent support will help PETA make major changes in this cruel industry and reduce the suffering of millions of farmed pigs.

    Your generosity today will be used to help PETA reduce the pain and suffering of myriad pigs, cows, fish, chickens, and other animals on massive factory farms—each one an individual who needs help.

    Please know this: PETA’s work gets results! We’ve already successfully pressured giants in the industry to make important changes with regard to how they breed, confine, and kill animals:

    • Following more than 100 PETA demonstrations across North America and negotiations with PETA, Safeway became the first Fortune 500 company to make dramatic improvements in the living and dying conditions of farmed animals, including making unannounced audits of its suppliers, establishing a purchasing preference for suppliers that don’t use gestation crates, and immediately purchasing a significant portion of its pig flesh from existing farms that do not confine animals to tiny cages. Safeway credited PETA with “turn[ing] on the light of an issue we need to address.”
    • PETA’s influence over its customers, including fast-food chains like McDonald’s and Burger King, convinced Smithfield Foods—the largest pig-flesh supplier in the world—to agree to phase out all gestation crates on its company-owned factory farms within a decade. Currently, at any given minute, more than 1 million mother pigs are confined by Smithfield to these hideous crates.
    • Just a few days later, Maple Leaf Foods, the largest pig flesh-producer in Canada, announced that it would follow suit. Then, almost immediately afterward, another massive pig-flesh supplier—Cargill Foods—agreed to stop using gestation crates on half its farms immediately.

    These decisions significantly reduce the suffering of pigs and have sent shockwaves through the entire meat industry. But we have much more to do, which is why we very much need your help.

    PETA’s high-profile protests and media outreach, consumer boycotts, and undercover investigations are doing what no one thought was possible: getting the world’s worst abusers of animals to clean up their acts. And none of this would be possible without your caring support.

    Please make a generous donation to PETA online right now. Your gift will help sustain our relentless defense of pigs and other animals who are, even as I write this, being abused, exploited, and killed.

    ]]>
    http://anandhansubbiah.com/blog/do-you-know-how-pigs-in-the-us-live-their-lives/feed/
    Hibernate Filters http://anandhansubbiah.com/blog/hibernate-filters/ http://anandhansubbiah.com/blog/hibernate-filters/#comments Thu, 03 Apr 2008 16:55:41 +0000 Anandhan Subbiah http://anandhansubbiah.com/blog/hibernate-filters/ Hibernate filters provide you with a programmatic way to restrict the result of your query.The advantage is that you can programmatically change filters even though you can’t do it at runtime it is still a better approach. In the following code sample I created a filter called activatedFilter and added it to the User class. You can specify or define the attribute in the filter-def. In this case the filter is boolean. You can enable the filter using the session.enableFilter() API.

    <?xml version='1.0' encoding='utf-8'?>
    <!DOCTYPE hibernate-mapping
       PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
       "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
     
    <hibernate-mapping>
      <class name="com.hibernatebook.filters.User">
        <id name="id" type="int">
          <generator class="native"/>
        </id>
     
        <property name="username" type="string" length="32"/>
        <property name="activated" type="boolean"/>
        <filter name="activatedFilter" condition=":activatedParam = activated"/>
      </class>
      <filter-def name="activatedFilter">
        <filter-param name="activatedParam" type="boolean"/>
      </filter-def>
    </hibernate-mapping>


    import java.util.Iterator;
     
    import org.hibernate.Filter;
    import org.hibernate.Query;
    import org.hibernate.Session;
    import org.hibernate.SessionFactory;
    import org.hibernate.Transaction;
     
    import org.hibernate.cfg.Configuration;
     
    public class SimpleFilterExample {
        public static void main (String args[]) {
            SessionFactory factory =
               new Configuration().configure().buildSessionFactory();
            Session session = factory.openSession();
     
            //insert the users
            insertUser("ray",true,session);
            insertUser("jason",true,session);
            insertUser("beth",false,session);
            insertUser("judy",false,session);
            insertUser("rob",false,session);
     
            //Show all users
            System.out.println("===ALL USERS===");
            displayUsers(session);
     
            //Show activated users
            Filter filter = session.enableFilter("activatedFilter");
            filter.setParameter("activatedParam",new Boolean(true));
            System.out.println("===ACTIVATED USERS===");
            displayUsers(session);
     
            //Show nonactivated users
            filter.setParameter("activatedParam",new Boolean(false));
            System.out.println("===NON-ACTIVATED USERS===");
            displayUsers(session);
     
           session.close();
       }
     
       public static void displayUsers(Session session) {
           session.beginTransaction();
           Query query = session.createQuery("from User");
           Iterator results = query.iterate();
           while (results.hasNext())
           {
               User user = (User) results.next();
               System.out.print(user.getUsername() + " is ");
               if (user.isActivated())
               {
                   System.out.println("activated.");
               }
               else
               {
                   System.out.println("not activated.");
               }
           }
     
           session.getTransaction().commit();
       }
     
       public static void insertUser(String name, boolean activated, Session session) {
           session.beginTransaction();
     
           User user = new User();
           user.setUsername(name);
           user.setActivated(activated);
           session.save(user);
     
           session.getTransaction().commit();
       }
    }

    ]]>
    http://anandhansubbiah.com/blog/hibernate-filters/feed/
    Hibernate Cache http://anandhansubbiah.com/blog/hibernate-cache/ http://anandhansubbiah.com/blog/hibernate-cache/#comments Thu, 03 Apr 2008 02:49:17 +0000 Anandhan Subbiah http://anandhansubbiah.com/blog/hibernate-cache/ Database operations are typically very expensive. A typical query would have to be first transmitted over the network. The database has to create a query plan for it and then execute it. The response then has to be transmitted over the network again before the client can process the results. Most databases will cache the results and some will cache queries thereby preventing the execution of the queries and sometimes eliminate the need for the query plan. But these are largely dependent on the number of unique queries and the network overhead is still there.

    The natural and obvious answer is to have a cache at the client end of the database connection. Hibernateprovides one cache (the first-level cache) through which all requests must pass. A second-level cache is optional and configurable.

    The L1 cache ensures that within a session the request for a object from the database always returns the same object instance hence preventing the object from being reloaded. You can always use object.evict() to discard the object and force a reload.To discard all objects in a session you can issue session.clear().This can also be called called a Java Virtual Machine (JVM) or SessionFactory-level class. . If you have a second-level cache at the SessionFactory level, the application objects are cached in a manner where they are available across sessions.

    The L2 cache also called as query cache is external to hibernate . Hibernate provides a pluggable interface for the L2 cache. This allows a cache to be shared between applications on the same machine or even between multiple applications on multiple machines. The L2 cache will not be able to react to changes made by an external application so you have to be careful not to lose the state of the data. Also a distributed cache creates lot of network traffic and takes up memory as well.

    Java threads do not timeout when there is a deadlock so don’t share sessions between different threads. If you absolutely must maintain an instance for a longer duration, maintain the instance within a ThreadLocal object. For most purposes, however, the lightweight nature of the Session object makes it practical to construct, use, and destroy an instance, rather than to store a session.

    Some of the widely used L2 cache implementations are

    EHCache
    An in-process cache which is not cluster safe but supports Query Cache. It can use memory as well as disk.

    OSCache
    An in-process cache which is not cluster safe but supports Query Cache. It can use memory as well as disk.

    SwarmCache
    A multicast distributed cache which is cluster safe(clustered invalidation) but does not support Query Cache.

    TreeCache
    A multicast distributed transactional cache which is cluster safe but does not support Query Cache.

    Configuration of EH Cache

    When the objects being cached need to be updated, the read-write usage mechanism is an appropriate option to choose. If you use database imports or have an alternate way to update the database this option will not be suitable. It becomes even more difficult if the cache is clustered. The database has to be locked for the cache and the database to be in sync.

    The nonstrict read-write cache is the same as read write except that it writes to the database occasionally.

    The following properties are available in the Hibernate Configuration files to handle cache setup:

    hibernate.cache.use_minimal_puts: Optimizes second-level cache operation to minimize writes, at the cost of more frequent reads (useful for clustered caches). Possible values are true and false.

    hibernate.cache.use_query_cache: Enables the query cache. The query cache is disabled by default. Possible values are true and false.

    Example

    Session session = SessionFactory.openSession();
    Query query = session.createQuery("from Users");
    query.setCacheable(true);
    List users = query.list();
    SessionFactory.closeSession();

    To explictly use EHCache :
    Add this property to the hibernate .cfg.xml

    <property name="hibernate.cache.provider_class">net.sf.ehcache.hibernate
    .Provider></property>

    Create a file ehcache.xml and make sure it is available in the classpath

     
    <ehcache>
     
        <diskStore path="java.io.tmpdir"/>
     
        <defaultCache
            maxElementsInMemory="1000"
            eternal="false"
            timeToIdleSeconds="120"
            timeToLiveSeconds="120"
            overflowToDisk="true"
            />
     
        <cache name="example.user.User"
            maxElementsInMemory="1000"
            eternal="false"
            timeToIdleSeconds="3600"
            overflowToDisk="true"
            />
     
        <cache name="example.user"
            maxElementsInMemory="1000"
            eternal="true"
            overflowToDisk="true"
            />
    </ehcache>

    timeToIdleSeconds specifies how long an object can be idle before it expires. The timeToLiveSecondsvalue specifies the overall length of time that an object can be cached before being expired.

    When not to use Cache
    1) When the database can be modified by an external source. You may be able to deal with this issue by specifying a version or timestamp property for your object and using the Session.lock() method to verify that the object hasn’t been changed.
    2)Caching only helps when the same data is used multiple times within the expiry time period. There is no point in caching data which expires before it can be used.
    3)In financial applications where auditing is very important.
    4)When the dataset is too large
    5) when you don’t know what the hell you are doing :)

    ]]>
    http://anandhansubbiah.com/blog/hibernate-cache/feed/
    Ibiza Rhapsody - Review http://anandhansubbiah.com/blog/ibiza-rhapsody-review/ http://anandhansubbiah.com/blog/ibiza-rhapsody-review/#comments Thu, 03 Apr 2008 02:17:52 +0000 Anandhan Subbiah http://anandhansubbiah.com/blog/ibiza-rhapsody-review/ ibiza Rhapsody H1A030BK 30 GB Wi-Fi/MP3 Player by Haier (Black)

    I wanted to write about this for a while now. The SVP of my company, Charlie Herrin presented me with this Linux based Personal Music Player . Before I go any further with my own experience of the product here is the list of awesome features of this player from Heir.

    1) Rhapsody support
    2) Wifi
    3) FM Radio
    4) Updatable skins via AirSkins
    5) Web Browser
    6) Video support (AOL)
    7) Podcast

    The player supports up to a max of 30GB which is quiet impressive. It can connect to any wi-fi network and stream rhapsody music on the fly.  You can store photos and the 2.5-inch LCD screen is very good to watch photos. You can transfer any format you want (my favorite is Youtube videos) using the Rhapsody software. The software actually encodes the videos so they are suitable for viewing in the player. There is no visible glitch when watching the videos mainly due to the linux kernel and the processor.

    If you are a Comcast customer like me you can download the Real Rhapsody software for free and listen to up to 25 songs for free. You can actually enter your rhapsody information in the device and listen to songs straight from the device without having to actually download and transfer them. If you have a Rhapsody All subscription then you can download as many songs as you want directly using the device or transfer songs from your computer. The songs will be licensed and you will have to connect the device the computer every 30 days to make sure they don’t expire.

    The AirSkins feature is really good as it gives you lot of skins you can choose from and most of the skins are actually very easy to use and pleasant.

    The only thing that can work against this player is the appearance. You will either love it or hate it. The User Interface could be better but once you are used it, the experience is not all that bad. The battery is the killer though as it drains very fast. The player actually ships without any equalizer support but the latest update seems to have fixed the problem. The quality of music is not all that great but I think the player works very well with Bose Headphones. There is not too much bass from the player and any typical Bose speaker enhances the bass at Zero to have a good audio experience in the car.

    Overall the player is worth the price ( around 250$’s) as it is packed with a lot of cool and useful features.

    ]]>
    http://anandhansubbiah.com/blog/ibiza-rhapsody-review/feed/