Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0016550Openbravo ERPA. Platformpublic2011-03-30 09:392011-04-05 00:00
roklenardic 
jpabloae 
normalminoralways
closedduplicate 
5
3.0RC5 
 
Core
No
0016550: Delete Client runs out of memory in community appliance
If running a community appliance for a while and then try to delete a client using the General Setup || Client || Delete client process, this fails with the following message:

org.openbravo.base.exception.OBException: Exception thrown Exception when creating query select p from ADPreference as p where ( ( coalesce(p.visibleAtClient, '0')='0') and ( p.visibleAtRole is null) and (coalesce(p.visibleAtOrganization, '0')='0')) and ( p.userContact is null) and ( p.window is null) and p.propertyList = 'Y' and p.property = ? ) and p.organization.id in ('0') and p.client.id in ('0') and p.active='Y'
    org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:63)
    org.openbravo.dal.core.DalRequestFilter.doFilter(DalRequestFilter.java:103)

root cause

org.openbravo.base.exception.OBException: Exception when creating query select p from ADPreference as p where ( ( coalesce(p.visibleAtClient, '0')='0') and ( p.visibleAtRole is null) and (coalesce(p.visibleAtOrganization, '0')='0')) and ( p.userContact is null) and ( p.window is null) and p.propertyList = 'Y' and p.property = ? ) and p.organization.id in ('0') and p.client.id in ('0') and p.active='Y'
    org.openbravo.dal.service.OBQuery.createQuery(OBQuery.java:237)
    org.openbravo.dal.service.OBQuery.list(OBQuery.java:112)
    org.openbravo.erpCommon.businessUtility.Preferences.getPreferences(Preferences.java:363)
    org.openbravo.erpCommon.businessUtility.Preferences.getPreferenceValue(Preferences.java:185)
    org.openbravo.erpCommon.security.Login.doPost(Login.java:99)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    org.openbravo.base.HttpBaseServlet.service(HttpBaseServlet.java:245)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.openbravo.utils.SessionExpirationFilter.doFilter(SessionExpirationFilter.java:66)
    org.openbravo.utils.CharsetFilter.doFilter(CharsetFilter.java:35)
    org.openbravo.dal.core.DalRequestFilter$1.doAction(DalRequestFilter.java:81)
    org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46)
    org.openbravo.dal.core.DalRequestFilter.doFilter(DalRequestFilter.java:103)

root cause

java.lang.IllegalStateException: org.postgresql.util.PSQLException: ERROR: out of shared memory
    org.openbravo.dal.core.DalSessionFactory.openSession(DalSessionFactory.java:181)
    org.openbravo.dal.core.SessionHandler.createSession(SessionHandler.java:110)
    org.openbravo.dal.core.SessionHandler.begin(SessionHandler.java:196)
    org.openbravo.dal.core.SessionHandler.getInstance(SessionHandler.java:77)
    org.openbravo.dal.service.OBQuery.getSession(OBQuery.java:513)
    org.openbravo.dal.service.OBQuery.createQuery(OBQuery.java:227)
    org.openbravo.dal.service.OBQuery.list(OBQuery.java:112)
    org.openbravo.erpCommon.businessUtility.Preferences.getPreferences(Preferences.java:363)
    org.openbravo.erpCommon.businessUtility.Preferences.getPreferenceValue(Preferences.java:185)
    org.openbravo.erpCommon.security.Login.doPost(Login.java:99)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    org.openbravo.base.HttpBaseServlet.service(HttpBaseServlet.java:245)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.openbravo.utils.SessionExpirationFilter.doFilter(SessionExpirationFilter.java:66)
    org.openbravo.utils.CharsetFilter.doFilter(CharsetFilter.java:35)
    org.openbravo.dal.core.DalRequestFilter$1.doAction(DalRequestFilter.java:81)
    org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46)
    org.openbravo.dal.core.DalRequestFilter.doFilter(DalRequestFilter.java:103)
No tags attached.
duplicate of defect 0016172 closed jpabloae It is not possible to delete a client 
png delete_client_crash.png (567,743) 2011-03-30 09:39
https://issues.openbravo.com/file_download.php?file_id=3783&type=bug
Issue History
2011-03-30 09:39roklenardicNew Issue
2011-03-30 09:39roklenardicAssigned To => alostale
2011-03-30 09:39roklenardicFile Added: delete_client_crash.png
2011-03-30 09:39roklenardicModules => Core
2011-03-30 11:54jpabloaeAssigned Toalostale => jpabloae
2011-03-30 11:54jpabloaeStatusnew => acknowledged
2011-03-30 12:00jpabloaeNote Added: 0035363
2011-04-04 12:40jpabloaeStatusacknowledged => scheduled
2011-04-04 12:40jpabloaefix_in_branch => pi
2011-04-04 12:40jpabloaeRelationship addedduplicate of 0016172
2011-04-04 12:40jpabloaeStatusscheduled => closed
2011-04-04 12:40jpabloaeResolutionopen => duplicate
2011-04-05 00:00anonymoussf_bug_id0 => 3274934

Notes
(0035363)
jpabloae   
2011-03-30 12:00   
This is related to the PostgreSQL memory allocation. It is necessary to increase it to remove this error. We'll deploy a fix for the appliance, but meanwhile you can apply it yourself in your current running ones:

1) Increase the kernel limits:

echo >> /etc/sysctl.conf
echo "# Openbravo - PostgreSQL" >> /etc/sysctl.conf
echo "kernel.shmmax = 268435456" >> /etc/sysctl.conf
sysctl -p /etc/sysctl.conf

2) Increase the PostgreSQL memory allocation:

Edit /srv/pgsql/8.4/postgresql.conf and set "shared_buffers" to 128MB.

3) Restart PostgreSQL:

/etc/init.d/tomcat stop
/etc/init.d/postgresql restart
/etc/init.d/tomcat start