Foros de discusión
Table autoincrement property gets removed
Samita Bhujbal, modificado hace 11 años.
Table autoincrement property gets removed
Regular Member Mensajes: 117 Fecha de incorporación: 5/07/11 Mensajes recientes
I am using Liferay 6.0.6. I am working on custom module for membership registration. I am using service builder for dealing with tables.. There are 20 tables involved on this module. I have made each table primary key autoincrement from SQLYog so that when data gets added in table it increments primary key automatically.
But sometimes this autoincrement property gets removed automatically. Also we have applied unique index to one table for one column. That also gets deleted automatically sometimes.
What Can be the reason? Is it due to I have set cron job on server which takes daily backup of database ? Or it may due to uploading the updated build on server??
But sometimes this autoincrement property gets removed automatically. Also we have applied unique index to one table for one column. That also gets deleted automatically sometimes.
What Can be the reason? Is it due to I have set cron job on server which takes daily backup of database ? Or it may due to uploading the updated build on server??
Bart Simpson, modificado hace 11 años.
RE: Table autoincrement property gets removed
Liferay Master Mensajes: 522 Fecha de incorporación: 29/08/11 Mensajes recientes
Each time you deploy with change in the service.xml Liferay will check for any changes and update the tables .
I don't understand why you did this and not do it the way liferay does it? (CounterService)
I have made each table primary key autoincrement from SQLYog
I don't understand why you did this and not do it the way liferay does it? (CounterService)
Samita Bhujbal, modificado hace 11 años.
RE: Table autoincrement property gets removed
Regular Member Mensajes: 117 Fecha de incorporación: 5/07/11 Mensajes recientes
I did it. But CounterLocalServiceUtil generates duplicate primaryid sometimes. Hence I changed to this.
Siby Mathew, modificado hace 11 años.
RE: Table autoincrement property gets removed
Expert Mensajes: 268 Fecha de incorporación: 4/03/11 Mensajes recientes
Have you implemented like this :
CounterLocalServceUtil.increment(yourEntity.class.getName());
Samita Bhujbal, modificado hace 11 años.
RE: Table autoincrement property gets removed
Regular Member Mensajes: 117 Fecha de incorporación: 5/07/11 Mensajes recientes
yes I did this only. But sometimes it was creating duplicate primaryID. So I removed this from code and set primaryId column as autoincremented in Mysql.
Sampsa Sohlman, modificado hace 11 años.
RE: Table autoincrement property gets removed
Regular Member Mensajes: 230 Fecha de incorporación: 27/09/07 Mensajes recientes
Hi Samita,
Can you repeat this behavior and which situation you are getting this?
Samita Bhujbal:
I did it. But CounterLocalServiceUtil generates duplicate primaryid sometimes. Hence I changed to this.
Can you repeat this behavior and which situation you are getting this?
Jaynil A Bagdai, modificado hace 11 años.
RE: Table autoincrement property gets removed
Regular Member Mensajes: 119 Fecha de incorporación: 3/03/12 Mensajes recientes
Hi Samita,
Do avoid these kind of issues use
Without giving entity name as parameter, this will always return you new and unique key for sure..
hope this helps you.
Thanks,
Jaynil
Do avoid these kind of issues use
CounterLocalServceUtil.increment();
Without giving entity name as parameter, this will always return you new and unique key for sure..
hope this helps you.
Thanks,
Jaynil
Samita Bhujbal, modificado hace 11 años.
RE: Table autoincrement property gets removed
Regular Member Mensajes: 117 Fecha de incorporación: 5/07/11 Mensajes recientes
But when we want to add entries for specific entity then giving entity name is necessary.