Tuesday, February 19, 2013

Aggregation


Aggregation means HAS –A relationship

Eg: Employee has Address
ie-
class Employee{
int id;
String name,salary;
Address address;//Address is a class
}
employee -> name, id, salary also has Address -> which itself has different attribute like pincode, city, country etc.
When there is no IS-A relationship(ie: inheritance), best way of code reuse is aggregation.
Inheritance should be used only if the –IS-A relationship is maintained in the life time of the object, otherwise aggregation is the best choice.

Android Version and Name

Version
Name
1.5
Cupcake
1.6
Donut
2.1
Éclair
2.2
Froyo
2.3
Gingerbread
3.1,3.2
Honeycomb
4.0
Ice cream sandwitch
4.1
Jelly Bean

Thursday, February 7, 2013

ERROR 2006 (HY000): MySQL server has gone away

Issue:


mysql -u root -proot123 mydb < /root/db-2013-01-30.sql
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...

Analysis:-

Actually dump file having large INSERT queries, and also “max_allowed_packet” size was set to very low value.

So, when the mysql client or the mysqld server receives a packet,which is bigger than max_allowed_packet bytes, it will throw error and close the connection.

Solution:-

In /etc/my.cnf , I updated the entry
max_allowed_packet=1M
to
max_allowed_packet=64M

now run the query for restore again:-
mysql -u root -proot123 mydb < /root/db-2013-01-30.sql

It worked!!