Friday, April 8, 2011
Monday, April 4, 2011
Letter To resp. President Of India for Cricket WC-2011 logic of paying Cricketers
Hi Just sent a letter To resp. President Of India for Cricket WC-2011 logic of paying Cricketers. Here it goes.
Respected Madam,
I am just another person living in India, and paying tax in the hope that it will be used for right cause & for right people. But recent Good incident also really make me feel sorry and low.
Yes, I am talking about Wining Cricket WorldCup. I am also fan of cricket and appreciate team for wining it. But got really sad when heard that public money is gonna be used for honoring them, that too with such a huge amount ( Rs. 1 Cr. per head )
I am not against giving them honor/recognition. But that can be done in far better way and constructive way than its being decided. eg. with > 6 Cr. a new public school can be build or up gradation of Public hospitals can be done, which can bring joy to many lives. We can give the name of the cricketers for their honors if needed. We can give medal if needed. But giving away such a huge amount from public money that too to the cricketers where majority of them are not really in that under paid or something. Also lemme also tell you that I am also a big fan of cricket, so its not that I am writing this because I dont love this game and all.
BCCI is NOT part of Govt. body, so do the players who are playing in it. Its like paying bonus to Employees of Pvt. Co. from Govt. treasury when that company is making profit..even that is also something that India will proud on when business will grow for that Indian Org. So should GoI declare bonus for them as well ?
I seriously oppose these decisions. Aren't soldiers on border, Honest Police person on road etc. are way too bigger heroes than Cricket team ? Why we are not honoring them with such a great rewards? And why only to Cricket ? There are so many other sports heroes, who won Gold for us, dont we have proud on them ?
I tried to send mail only to Resp. PM of India. I didn't find his email address. And sadly link http://pmindia.nic.in/ write.htm to write him at his website http://pmindia.nic.in/pmo.htm is also NOT working.
So bothering you. Hope you will get some time out of your hectic schedule for Just another civilian. I expect a thoughtful time of yours in this issue, and hope you will take some decision which is in favor of country !!
Respected Madam,
I am just another person living in India, and paying tax in the hope that it will be used for right cause & for right people. But recent Good incident also really make me feel sorry and low.
Yes, I am talking about Wining Cricket WorldCup. I am also fan of cricket and appreciate team for wining it. But got really sad when heard that public money is gonna be used for honoring them, that too with such a huge amount ( Rs. 1 Cr. per head )
I am not against giving them honor/recognition. But that can be done in far better way and constructive way than its being decided. eg. with > 6 Cr. a new public school can be build or up gradation of Public hospitals can be done, which can bring joy to many lives. We can give the name of the cricketers for their honors if needed. We can give medal if needed. But giving away such a huge amount from public money that too to the cricketers where majority of them are not really in that under paid or something. Also lemme also tell you that I am also a big fan of cricket, so its not that I am writing this because I dont love this game and all.
BCCI is NOT part of Govt. body, so do the players who are playing in it. Its like paying bonus to Employees of Pvt. Co. from Govt. treasury when that company is making profit..even that is also something that India will proud on when business will grow for that Indian Org. So should GoI declare bonus for them as well ?
I seriously oppose these decisions. Aren't soldiers on border, Honest Police person on road etc. are way too bigger heroes than Cricket team ? Why we are not honoring them with such a great rewards? And why only to Cricket ? There are so many other sports heroes, who won Gold for us, dont we have proud on them ?
I tried to send mail only to Resp. PM of India. I didn't find his email address. And sadly link http://pmindia.nic.in/
So bothering you. Hope you will get some time out of your hectic schedule for Just another civilian. I expect a thoughtful time of yours in this issue, and hope you will take some decision which is in favor of country !!
Tuesday, March 29, 2011
Grails App Monitoring Plugin
Just found a very good Grails Plugin for Grails App monitoring: http://grails.org/plugin/grails-melody
Worth giving a try !!
Worth giving a try !!
Understanding Grails GORM Secondary cache.
Hi,
I always wanted to find out some detailed doc. which could explain me how GORM is managing Secondary cache (via Hibernate Obviously) for us. Obviously GORM gives us sugar coated way of defining Domains which are alowing us to call dynamic finders like find, findAll, finAllByXXX etc. and also allows us to fire Criteria, HQL etc. on that domain.
You can get basics of this stuffs in grails doc. which is kind of good enough. But one thing I still feel is lacking the focus in Grails Doc. is the Secondary cache. Its not describing behavior of caching. Although part of it actually related to Hibernate, so thats why its not been docmented well there.
Reason why I am writing this post is : http://grails.1312388.n4.nabble.com/Effect-of-Enabled-Hibernate-Level-2-cache-on-Domain-td3405253.html
Here are some basics that we should know atleast before going to further details.
Scenarios:
I will keep adding more details as I will learn more of this.
All kind corrections or inputs are welcome !! Feel free to comment here or reply me on my email address as mentioned on facebook.
I always wanted to find out some detailed doc. which could explain me how GORM is managing Secondary cache (via Hibernate Obviously) for us. Obviously GORM gives us sugar coated way of defining Domains which are alowing us to call dynamic finders like find, findAll, finAllByXXX etc. and also allows us to fire Criteria, HQL etc. on that domain.
You can get basics of this stuffs in grails doc. which is kind of good enough. But one thing I still feel is lacking the focus in Grails Doc. is the Secondary cache. Its not describing behavior of caching. Although part of it actually related to Hibernate, so thats why its not been docmented well there.
Reason why I am writing this post is : http://grails.1312388.n4.nabble.com/Effect-of-Enabled-Hibernate-Level-2-cache-on-Domain-td3405253.html
Here are some basics that we should know atleast before going to further details.
- There are dedicated regions for Domain cache and Query (standard query cache) cache. And one more special region called as "org.hibernate.cache.UpdateTimestampsCache". You will find enough docs online to understand what "org.hibernate.cache.UpdateTimestampsCache" is. So I wont go into its details for now.
- Dont forget that Hibernate Queries will get cached only if Secondary Query cache is enabled.
- Domain cache puts (a single row) Domain Instance in this cache region with key generated as follows: [Fully.Qualified.class.name:PrimaryKey]
- Domain cache regions can be futher be customized to store a particular type of Domains only. This is to handle a situation where some domain cache has to expire soon or infrequently, or number of domain to be cached as to be different than other default cache (maxElementsInMemory) size.
- Standard Query cache region is a seperate dedicated region, created automatically by Hibernate to store the results of the Cached Queries. It stores PK of all the rows that comes as result for the Query being fired. Its key is generated with following things: QueryStatement and Paramters map. This is because same query can be fired to get different result, for example to get paginated view, we keep on fireing same query, what we change is just the offset/start_index paramter in the query. And when results are got, we have to keep it seperate for each page in the cache.
- If query cache is enabled in hibernate config, (datasources.groovy in our case), still to make sure that Dynamic finders caches it, we have to add cache:true in the params that we pass to the method. But list() method will not require it. It seems to assume put in the cache if query cacahe is enabled in hibernate config (datasource.groovy)
- Mapping cache true declaration in domain allows domain instance to be part of Secondary cache regions which is dedicated for storing actual domain objects
Scenarios:
- Hibernate Cache + Query Cache is enabled, *NO* mapping of cache true in domain class, but cache : true specifieed in dynamic finder (findAll and findAllByxxx and criteria etc):
- If we fire dynamic finder like (findAll, findAllByxxx) with Query cache = true.
i. Query resuls (PK) gets stored in cache. But Domain itself is not Cacheable because we have not mentioned mapping cache true in Domain class, Hibernate wont put it in the domain cache. So if you hit same flow with same paramter again, Hibernate knows what all rows it requires as it knows PK of all rows in the results set for given query with specified paramters,
So it fires individuals queries to DB for each expected rows with its PK. So assume that for the first time when Hiberate got 10 results for the given query and its params, if you fire same query with same params, hibernate will fire 10 (YES its 10) select SQL queries which is really * BAD * - If we fire get(PK) method, and assume the PK we are already looking for NOT there in the Cache, it will get it from DB and CAN NOT put it in cache. So that every time you fire get(PK) it will get data from DB.
- If you did a insert/update anywhere in the table, whole Query Cache for that domain (of that type) will become invalid. Doesn't matter if Update has any changes in the Domain instance you are interested in or not. Its logically in-correct, but practically its too difficult to implement, and Hibernate guys have taken the obvious and simple route there to handle this situation by invalidating the cache. Domain cache for this cache is anyways ot having Domain o fthat type as cahe true mapping is not declared.
- Hibernate Cache + Query Cache is enabled, Mapping of cache true in domain class, but cache : true specified in dynamic finder (findAll and findAllByxxx and criteria etc):
- If we fire dynamic finder like (findAll, findAllByxxx) with Query cache = true. Query resuls (PK) gets stored in cache. So if you hit same flow with same paramter again, Hibernate knows what all rows it requires as it knows PK of all rows in the results set, it checks in secondary domain cache for PK, and it finds it there so no need to go to DB. * GOOD *
- .If we fire get(PK) method, and assume the PK we are already looking for is already there in the Cache, it will get it from Cache, else will go to DB and put it in cache as well apart from returning to you. So that next time you fir get(PK) and cache is still valid, it will get data from cache.
- If Domain instance you want is already in Secondary cache, but you did a insert/update anywhere in the table, whole Cache (Domain Cache + Query Cache) for domain of that type will become invalid. Doesn't matter if Update has any changes in the Domain instance you are interested in or not. Its logically in-correct, but I think practically its too difficult to implement, and Hibernate guys have taken the obvious and simple route there to handle this situation by invalidating the cache.
- Dynamic finder's results are in Query cache. Suppose it returns 150 Rows. So Domain cache will have to store 150 domains in it. When you dont have enough space in memory to hold all those data, it should ideally overflow to disk store if enabled. This time your domain class will be stored in a disk file managed by eh-cache internally. You mention where to keep that files on disk in ehcache.xml file with <diskStore path="user.home/ehcache_data"/>
node.
I will keep adding more details as I will learn more of this.
All kind corrections or inputs are welcome !! Feel free to comment here or reply me on my email address as mentioned on facebook.
Friday, March 18, 2011
BSNL Broad band Pune Issue (resolved)
Hi,
I got BSNL dataone broadband at Wakad, Pune just 2 days back. Since day one I started facing issue. Not that net is not working and all. But it used to stop loading page inbetween for many websites. And funniest part was that even facebook pages at times never used get loaded completely. I saw many js, image files are never getting loaded completely.
Initially I thought some issue with DNS. But As half of the page is getting loaded from the same domain where download is stuck while loading is going on, its really not possible to blame DNS.
This made me really crazy, my half a day was wasted because of this while I was developing an app using Facebook Javascript SDK. It never used to download http://connect.facebook.net/en_US/all.js, but facebook domain is always reachable with traceroute and normal page load during browsing.
Issue got resolved final in my router configuration. I set TCP MTU=1300 and magic happened. Frankly speaking I still need to go through greater details about significance of this field, but for now this tweak is atleast allowing me to keep a smile on my face :)
I got BSNL dataone broadband at Wakad, Pune just 2 days back. Since day one I started facing issue. Not that net is not working and all. But it used to stop loading page inbetween for many websites. And funniest part was that even facebook pages at times never used get loaded completely. I saw many js, image files are never getting loaded completely.
Initially I thought some issue with DNS. But As half of the page is getting loaded from the same domain where download is stuck while loading is going on, its really not possible to blame DNS.
This made me really crazy, my half a day was wasted because of this while I was developing an app using Facebook Javascript SDK. It never used to download http://connect.facebook.net/en_US/all.js, but facebook domain is always reachable with traceroute and normal page load during browsing.
Issue got resolved final in my router configuration. I set TCP MTU=1300 and magic happened. Frankly speaking I still need to go through greater details about significance of this field, but for now this tweak is atleast allowing me to keep a smile on my face :)
Wednesday, March 9, 2011
Subscribe to:
Posts (Atom)