- Close Eclipse
- Delete
/.metadata/.plugins/org.eclipse.jdt.core/*.index - Delete
/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt - Start Eclipse again
Sunday, August 30, 2009
Eclipse Search not working ( java search class filename must end with .class)
Saturday, July 4, 2009
Sunday, January 18, 2009
Monday, December 22, 2008
Server side Prepared statements in MYSQL + Java
Below is an example datasource setting in JBOSS
Wednesday, December 10, 2008
JBoss Performance Tuning
JVM Settings
a) JAVA HEAP SIZE
b) PERM GEN SPACE
c) Parallel GC? (Good for multi CPU systems)
DB settings
a) Max Pool and Min Pool sizes for all Oracle and MySQL Pools.
b) idle-timeout-minutes
c) blocking-timeout-millis
HTTP connector Settings (Thread Pool Settings)
a) Max Threads -- Concurrency
b) Accept Count -- Queue size of each thread
c) Compression -- True/False
JSP Compilation Settings
a) We don't need to check for compiled JSP's every now and then unlike in dev.
b) No debugging for JSP's.
Security Settings
a) Remove universal access to JMS console and WEB consoles.
b) We can even try to restrict the access to this from the local machine.
Log4J Settings
a) Make sure we log only the critical errors.
http://tomcat.apache.org/tomcat-5.5-doc/config/http.html
Load Testing the application
a) This is one critical part that needs lot of application context. First of all we have to be really clear on what we are going to load test and the most probable pain points to look for. Then we can think of the data to test with.
Hibernate Settings
a) Cache Size
OS Settings
a) Large Pages (2.6 kernel supports it seems)
Apache for serving Static Content
a) Traditionally App servers are not great at serving static content. Apache is generally good when it comes to a serving static content. Some reasons for this are web servers having their own disk caching etc.
b) Over time, app servers have improved a lot in serving static content. But going for a web server for serving static content gives us the flexibility of creating a new domain and the content download can happen much faster.
References
- http://www.jayson.in/wp-content/uploads/2008/08/jboss-folder-structure.jpg
Thursday, November 20, 2008
Motivation!!!
Of course things should also be communicated in a better manner!! And guys should be motivated every now and then!! I always wonder if I ever learn the definition of "motivation" :( But what's motivation!! Is it pushing people to get the chores done!! Or is it trying to extract "more" from someone!! What's "more"? How much is that? If we can't even get the basic things done, can we even/ever get to the extent of extracting "more". I doubt!! But why should we even "motivate"? If someone is paid for and expected to do certain things by following certain well-established practices, do we additionally need to "push" them also? If the answer is "yes", I hate being a manager.
For me "motivation" means a positive way of influencing peers by setting some high standards!! Actions but not the words should speak.!!
Stopping here as I get irritated more and more to work when I think of these things!!
Sigh!!!
Sujay
Thursday, November 6, 2008
What the heck is going on in life!!!
My favorite leader
The election day was finally there. I woke up an hour early than my regular schedule with the anxiety of catching up with the election results. I opened cnn.com and to all my delight the top story reads out "Obama is gaining momentum across all the states". Minutes later Dems took a clear lead of Ohio, the battleground state and a traditional strong hold of the Reps. As the time pass by, more and more states are taken by the Dems and all that Mc Cain could do is to "concede". It's official and Obama is the new American President. Three cheers to the "leader"!!!
The first phase and probably the easiest phase is over and he has done with ease by keeping his cool all the way. But the road ahead for him may not be any smooth. He is probably getting into the hot seat in the toughest of times. Nothing is going well for the Americans. I believe that he has all the capabilities to take care of these serious problems and wish him all the best in his tenure at white House!!
Monday, November 3, 2008
Try to blog regularly!!
But now I should be free and will update my blog regularly!!
Multiple columns having default TIMESTAMP
Follow the below example.
mysql> create table multicolsdefaultts (name varchar(100),date_modified timestamp,date_added timestamp);
Query OK, 0 rows affected (0.03 sec)
mysql> show create table multicolsdefaultts;
CREATE TABLE `multicolsdefaultts` (
`name ` varchar(100) NULL,
`date_modified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`date_added` timestamp NOT NULL default '0000-00-00 00:00:00'
)
mysql> insert into multicolsdefaultts values ('sujay', null,null);
Query OK, 1 row affected (0.00 sec)
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql> select * from multicolsdefaultts;
+-------+---------------------+---------------------+
| name | date_modified | date_added |
+-------+---------------------+---------------------+
| sujay | 2007-01-09 23:52:31 | 2007-01-09 23:52:31 |
+-------+---------------------+---------------------+
1 row in set (0.00 sec)
mysql> update multicolsdefaultts set name='sujay1';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql> select * from multicolsdefaultts;
+--------+---------------------+---------------------+
| name | date_modified | date_added |
+--------+---------------------+---------------------+
| sujay1 | 2007-01-09 23:52:44 | 2007-01-09 23:52:31 |
+--------+---------------------+---------------------+
1 row in set (0.00 sec)
mysql> insert into multicolsdefaultts(name) values ('Andale');
Query OK, 1 row affected (0.00 sec)
mysql> select * from multicolsdefaultts;
+--------+---------------------+---------------------+
| name | date_modified | date_added |
+--------+---------------------+---------------------+
| sujay | 2007-01-09 23:52:31 | 2007-01-09 23:52:31 |
| Andale | 2007-01-30 17:02:01 | 0000-00-00 00:00:00 |
+--------+---------------------+---------------------+
mysql> insert into multicolsdefaultts(name, date_added) values ('Andale2', null);
Query OK, 1 row affected (0.00 sec)
mysql> select * from multicolsdefaultts;
+---------+---------------------+---------------------+
| name | date_modified | date_added |
+---------+---------------------+---------------------+
| sujay | 2007-01-09 23:52:31 | 2007-01-09 23:52:31 |
| Andale | 2007-01-30 17:02:01 | 0000-00-00 00:00:00 |
| Andale2 | 2007-01-30 17:12:01 | 2007-01-30 17:12:01 |
+---------+---------------------+---------------------+
The important things to remember here are
- MySQL gives warnings or errors if you try to insert an illegal date. But by using the ALLOW_INVALID_DATES SQL mode, we can still store illegal dates.
-
CREATE TABLE t (ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
. This allows to update the column to currenttime during row creation as well as updation.
Sunday, October 21, 2007
Farewell to my beloved Manager ..
If I remember correctly, it was some time in November 2005, I moved under Karthik from Ravi/Ardaman after completing the Counters MySQL Migration beast. The first project i had worked under him is "Moving the eBay API to the new schema" which went out really good and then started our journey, a journey filled with all the positive adjectives like happiness, joy, love, respect and so on. From there onwards, there is no looking back.
He always tries to find out the interests of us, extends his complete support for them and make sure they gets fulfilled. Back in mid 2006, after working alone on the counters product for almost close to 1.5 years, I expressed my intent to come out of that hell, loneliness. And within no time, I was given a non-Counters project, I started working on a Java project. He is kind enough to give me some time in learning Java also. There are lot of other instances where he proved himself to be "the leader".
Believe it or not, all this has happened through Phone and email. He is in US office and we used to work from Bangalore. (sounds unrealistic...cant do anything..it happened). Luckily, once i got an opportunity to work with him directly for around 4 months. That was an amazing experience, an experience of a life time. The best part in Karthik, he treats you so well, you will never end up with a feeling of hesitation to express something. And he really understands things and try to provide all the help that he can. The other thing that I really like in Karthik is the freedom that he gives you to do things. He always encourages new ideas and always game for experimentation (My guy).
I am just speechless when I heard the word "leaving" from him. I am just shocked/surprised. Cant do much now. He is decided and he is moving. He is the best manager i have worked with., of course, one anyone can work with; i can only say ATB to him for all his future endeavors and I wish i would work with him some time soon.
Wednesday, June 13, 2007
Key points from June MySQL Meetup (MV chapter)
Below are the things which I found interesting from the session.
a) Question 1: How good is MySQL to store images? (Same as, how good is MySQL for blobs)
Though there is no straight forward answer on how many images (size??) will MySQL hold comfortably, he is saying that we can safely rely on MySQL if the size of blob is in KB’s If the size of blob is in MB’s, then MySQL may not be right choice. One of the main reasons behind this is that MySQL doesn’t use streaming to send blobs across the network. So if there is a blob of size 1G, then it requires 1G (or more?) on server and 1G (or more?) on client too to effectively transfer the blobs. MySQL is trying to address this problem by implementing streaming in its future releases.
For storing big blobs, the other open source tool that we can really look at is MogileFS. This is a very good system for Blobs it seems.
http://danga.com/mogilefs/
b) Question 2: How good is MyISAM compared to INNODB for applications where the data is loaded only once and don't change for ever?
The one thing that MyISAM suffered from all the time is the regular data corruption. But if we have a backup of the data in the file system which we can use at any time to load it back to the DB w/o taking much of time, we can safely use MyISAM. Also one other way to cope up with data corruption easily is, at the time when we are loading the data to Research DB, try to load the same data into a backup MySQL DB and incase of any corruption we can simply override the corrupted files from the backup.
c) Question 3: How effective using Query Cache would be?
There is one very interesting point that Jeremy has made here. Query cache flushes out a query if the table on which that query operates changes. It doesn't matter whether some thing has changed with respect to the rows it has stored or not. This clearly tells that Query Cache is not an option for any application that does decent writes to the DB. It just adds an additional overhead of searching in Query Cache for every query unnecessarily. Please turn off Query Cache or add the SQL_NO_CACHE hint to all the required select queries, if you still have some compelling reasons to go for a Query Cache.
d) Question 4: What's the best way to go about backups?
Jeremy has suggested using LVM snapshots to take backups from INNODB. From his experience, INNODB hot back tool (Commercial tool from INNODB) is not recommended. From my experience, don't go for Zmanda as it is just a script on top of the things offered by MySQL. It is definitely not worth paying 500$ per license every year for this very basic s/w.
e) Question 5: What's the best way to setup MySQL Replication? (Dual-Master or Master-Slave?)
The straight answer is to go for a Dual Master setup. Two other important things he has made is that, always set read-only=1 and skip-slave-mater=1 on master. We have to this once the master comes up. The advantage of doing this is that, if for some reason master fails and we have switched to slave, and when the master comes back again, it should not accept any connections for write. And other very important point he has made here is that, in case of failure on master, never try to apply the lost transactions automatically rather do it manually by comparing the sequence numbers on slave and master. Its better to spend couple of minutes looking at what went wrong rather than spending sleepless nights if the automated script really screws something. :)
f) General Discussion:
a. Size of bin-logs can be around 768M. (Not too high or too low). From his experience, bin-logs of this size would take around 5-10mins for recovery.
b. Always give minimal space for MyISAM (64M ??) as MySQL internally uses MyISAM to store some system tables and also for creating any temp table, it uses MyISAM.
c. The o/p of show status in 4.* versions gives all global values for variables where as in 5.* to get the same o/p we have to use "show global status". "show status" now gives info only for that session.
d. Always set no-auto-rehash under the client section of the my.cnf. This makes sure that MySQL don’t try to create tab completion indexes for every new client connection.
e. There is a way to look at the life cycle of a query on MySQL. This works from 5.0.37 community and 5.0.42 enterprise onwards. Please go through the below link for extra information on this, http://dev.mysql.com/tech-resources/articles/using-new-query-profiler.html .
f. Always try to keep number of files in a directory in hundreds and not more than that as many FS’s including ext3 do a linear search of files inside a directory.
I am really impressed by the way Jeremy has handled the whole session and I am looking for the future events.
Hmm..Have to go back to work. :)
Monday, January 8, 2007
icicibank.com -- Make online banking a nightmare
In their quest to provide the best service, they are keeping the site under maintainance 24x7. :))) . Guys, agreed, you are the best one in town. please come out of the maintainance mode now atleast.. :))
Customers --> Don't only think of the sops they provide. It also matters how well they provide the services to you. And w/o any doubt, icicibank response to user queries is a complete mess. You have to wait indefinitely for your call to get transferred to the right department. God knows, whether it gets transferred finally or not. You have to be a really lucky person to get your query answered.
Adding to all these, icici also holds the record for loosing the crictical DMAT documents in the MUMBAI rain waters last year. Great!! i am hearing the applause too :) .. And people are asked to fill their application forms again.. :) This explains the carelessness of these people towards customers.
Summary --> ICICI service sucks, icicibank.com is hopeless, icicidirect may get drowned in rain waters sometime. Never choose icici as your salary account.
Sequences in MySQL
But auto_increment has some limitations compared to its counterpart in Oracle.
- AUTO_INCREMENT is limited to one column per table
- AUTO_INCREMENT must be assigned to a specific table.column (not allowing multi table use)
- AUTO_INCREMENT is INSERTed as a not specified column, or a value of NULL
Even if a row is deleted, the sequence wont be reset to its previous value.
Prior Connect in MySQL
The work arounds for this problem can be found at this place.
http://forums.mysql.com/read.php?10,32818,32818#msg-32818
http://jan.kneschke.de/projects/mysql/sp/
A very good theoritical explanation for the same can be found at
http://www.intelligententerprise.com/001020/celko.jhtml?_requestid=697912
Tuesday, December 19, 2006
Google Checkout Rocks!!!
There is a lot of buzz going around that Google checkout is not working up to the expectations and as a result many buyers hasn't got their orders at all. People even has gone up to the extent of saying that Google should not have released the Google checkout in the festival season. (Will Google ever bother about the timing of the release for any of their products!!!)
But the reality is that Google checkout is an excellent product from the Internet master and it makes the life of developer very easy without compromising anything on the buyer experience.
Anyone should appreciate Google checkout for having
- Robust Notification Mechanism. Google makes sure the notification is reached to the third party e-commerce provider. It tries for almost 3 days.
- The way they have broken the whole Checkout process into minute steps is amazing. Some people even term it as Extreme engineering and often say that Google doesn't really need to worry about every thing at the finest levels of granularity.
- An API that adheres to the RFC standards. We doesn't need to bother about the error message. The error code in the status field speaks everything.
- The documentation is great and it would be a cake walk for the developer to implement it.
Features, design and implementation and what not!! .. definitely Google has set its standards in all these fields and we can easily identify them in every of their products and Google checkout is not an exception. Then why are people still complaining that Google Checkout is not up to the mark.
The most common reason why people complain about Google checkout is that they have not received the orders they have ordered for. So if someone doesn't receives the orders they have made, is it Googles mistake all the time?? Definitely NOT. Most often than not, sellers display more inventory than they actually possess. This is the major culprit in this whole problem. If a seller finds an order from a buyer for which he doesn't have any inventory left, he simply ignores it (Is it the responsibility of the third party e-commerce provider to sort out these things!!No idea :D). But the blame here ultimately goes to the middle man.. Google.
And this is not something that Google is only suffering from. There are lot if cases of such instances on eBay and Walmart also, the biggest e-commerce provider and the biggest retailer. They too had shared their part of problems (or blame??).
Learning from their (or others ??) mistakes, these guys have acted right this year. eBay has restricted their sellers from selling more than one PS-III. (supposedly the hottest item for the festive season this year). Walmart also learnt from its mistakes last year and made the ad campaign for this festive season offers this year very carefully.
I am not trying to say that Google Checkout is flawless but i only mean to say that it is not bad for all the reasons people are coming up with. Still I always say "Hail Google :D "
Monday, December 18, 2006
MySQL's workaround for Oracle's ROWNUM
MySQL's equivalent to Oracle's rownum is limit.
Limit takes two numeric arguments, the first argument is the offset of first row to return (offset of the first row in the results starts from 0 and not 1) and the second argument takes the maximum number of rows to return from the specified offset.
e.g: where rownum between 10 and 20 <---> limit 10,20
One other common use of rownum in oracle to copy the table structure.
e.g: create table mytable_copy as (select * from mytable where rownum <0);
The equivalent in MySQL is
Hope this helps. Please contact me in case of any queries.
Friday, December 15, 2006
Trip to Club Cabana
Though my third visit to this place, i still was very excited about this place as i always rate this as the best club in and around bangalore. This one is also a different and special one from all of our previous visits to this place as this is the first trip sponsored by Vendio after acquiring us. The trip is supposed to start at 8:00 AM from our office and surprisingly it started almost at right time :D. We reached the place at around 9 and straight went to the place where the breakfast is served and juntaa had no hesitation in showing off their appetite for food.
This one is the image of the club cabanas entrance which which hosts the breakfast hall, water sports, bowling alley and the spa.
If you are the one who loves water games and indoor games like bowling, this would be the perfect place to hang out.
But this is definitely not the p
there. :)
This time we have gone to this place with an agenda. Swimming..swimming and swimming. But after looking at the volley ball court with the surface filled with loose sand, no way i can resist myself from getting into the action. And then..you are right..we started playing with a fungame which soon transformed itself into a much disciplined one. Andale guys once again proved they can learn anything very easily and volley ball is not an exception. Hail Andale...(Of course, Vendio tooo) :D
I am the one in the Brown T-shirt. Too involved into the game !!!
The one in the Red T-shirt is kukka alias DOG.
One playing in the left most corner is Rajesh from NOC.
You call it coincidence !!! never mind.. but it is the fact.. Today is his marriage. Happy wedding day Rajesh !!!!
And the volley ball session has finally come to an end. Had a few snaps and then left towards the swimming pool. "what a shot !! amazing !!!" , words of praise has suddenly caught our attention and we automatically walked down to find the source of this enthusiasm...but not really surprised by the reality...enthu andale youth are enjoying the treat offered by our BITS BOSM baddy captain Yashwant. Though many people are there in the queue for the next match, we some how managed to get the rackets but only to successfully loose the game to our great opponent BRA (alias RAM!!) .
Yet another one.. this time baddy.. has distracted us from our agenda. But this time we are very determined.. Closed evrything :D and moved straight towards the swimming pool. No more latency allowed.. got into the bogs.. changed the attire to get into swim costumes.. got a good shower... oooooooooohhh!!! all set to get into the pool.. but the water with below normal temperature is not ready to say WELCOME to us..as it always used do. But, enthusiasm has finally won and we are into the pool.. its a close to 6ft deep pool and kukka tried to learn a bit of swimming taking advantage of his height :).
This is the one. A very pelasant one. Isnt it!!
The round table is there to have drinks while you are enjoying the swim.
I had a couple of breezers and DOG had a beer. Thanks to Rohit for getting the drinks!!!
Lunch Time!!! and we are back to the hall where we had breakfast. Though i have strong appetite for non-veg, for all the good reasons i have successfully avoided it and finsihed a meal with vegetarian items. Sometimes you feel veg is not that bad to eat :) . and this is one such situation.
The adenaline levels are coming down slowly (obviously coz of the heavy lunch!!) and fear has caught us that we may actually go back without doing lotta things. These low harmone levels has pushed us into an unusual territoty...bowling. Though not a fanatic of this dumb sport, i got into the game to test my skill. Of course the results are quite promising.. no strikes for long time.. soon quitted the game after i feel i have got enough enrgy to get into the mainstream of things. Of course for me main stream is always getting into water...:D
Then got into the tidal wave pool but not able to keep myself in that for long times as i was already out of energy.. But this one is something that anyone should visit club cabana for.
Thursday, November 23, 2006
Long funfilled weekend ahead
Trip to Club Cabana
The trip is supposed to start at 8:00 at Andale office but i am pretty sure all these lazy guys will postpone it by atleast another hour. The generic agenda is to get down at the club, have breakfast, get into some outdoor activities, have lunch, water games and finally the one which no one ignore, the cocktail party.
But my agenda would be get down at the club, get into the swim pool, have lunch (is it really needed, yes otherwise you wont get enough enrgy for the afternoon session), get into the swim pool, taste all the cocktails , back to home (sorry railway station) by 10:30 PM.
Once i come back i will update here all the trip details.
bye for then
have a nice long weekend
