2
I have an application in development in Java using Hibernate and Primefaces, on the item listing screen I have the option to do a search for some information in real time using multiple filters.
However when running the application and performing some tests I have following return in the output of my development console.
WARN: SQL Error: 1040, SQLState: 08004
ERROR: Data source rejected establishment of connection, message from server: "Too many connections"
Informações: javax.el.ELException: /listaProduto.xhtml @45,83 value="#{produtoBean.pesquisa()}": org.hibernate.exception.JDBCConnectionException: Error calling Driver#connect
javax.el.ELException: /listaProduto.xhtml @45,83 value="#{produtoBean.pesquisa()}": org.hibernate.exception.JDBCConnectionException: Error calling Driver#connect
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:114)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
at javax.faces.component.UIData.getValue(UIData.java:732)
at org.primefaces.component.datatable.DataTable.getValue(DataTable.java:1002)
at org.primefaces.component.api.UIData.getDataModel(UIData.java:629)
at org.primefaces.component.api.UIData.setRowModel(UIData.java:436)
at org.primefaces.component.api.UIData.setRowIndex(UIData.java:428)
at org.primefaces.component.api.UIData.visitTree(UIData.java:717)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1700)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1700)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1700)
...
It is possible to clean the research as new?
We will need more details: how is your code to open/close Hibernate session? Or is it managed by some framework (Spring, EJB, etc)? This error always occurs or is intermittent?
– Dherik