Skip to main content

Posts

Showing posts from December, 2022

Update your Unique Primary Id using LAST_INSERT_ID()

 A   trick   for using   LAST_INSERT_ID()   to generate sequences in MySQL. Quoting from the Manual: Create a table to hold the sequence counter and initialize it: mysql> CREATE TABLE sequence (id INT NOT NULL); mysql> INSERT INTO sequence VALUES (0); Use the table to generate sequence numbers like this: mysql> UPDATE sequence SET id=LAST_INSERT_ID(id+1); mysql> SELECT LAST_INSERT_ID(); This trick calls for trouble. Contention A customer was using this trick to generate unique session IDs for his JBoss sessions. These IDs would eventually be written back to the database in the form of log events. Business go well, and one day the customer adds three new JBoss servers (doubling the amount of webapps). All of a sudden, nothing works quite as it used to. All kinds of queries take long seconds to complete; load average becomes very high. A short investigation reveals that a very slight load is enough to make for an accumulation of sequence-UPDAT...

How to extend JQuery bass class in the VtigerCRM

  [Vtigercrm-developers] jQuery.Class and extend() Prasad   prasad at vtiger.com Wed Jun 25 03:41:25 GMT 2014 Previous message:  [Vtigercrm-developers] jQuery.Class and extend() Next message:  [Vtigercrm-developers] jQuery.Class and extend() Messages sorted by:   [ date ]   [ thread ]   [ subject ]   [ author ] Alan, registerEvents is the main function that gets invoked on the client-side javascript controller. Either new / extend works. With extending the base list view it gets the other function definitions that can be invoked at sometime later. WorldClock v1 example doesn't follow the same UI conventions as its parent and hence does not invoke the parent method. Have a look at few standard modules like (Contacts < http://trac.vtiger.com/svn/vtiger/vtigercrm/branches/6.0.0/layouts/vlayout/modules/Contacts/resources/Detail.js >, Rss < http://trac.vtiger.com/svn/vtiger/vtigercrm/branches/6.1.0/layouts/vlayout/modules/Rss/resources/Lis...