[EJB 3.0] - select returns incorrect results
by snau2005
Hi,
Time to time I get wrong select results.
Simple query:
select f from EntityName where upper(f.columnName) like :paramOne
if paramOne = "test1" query should return ONE object
if paramOne = "test2" query should return TWO object
if entity (EntityName) was not used for some time and
if I first execute query with paramOne = "test1" jboss returns ONE object and thats is ok, but if I after that execute query with paramOne = "test2" jboss returns only ONE object, but it should return TWO objects.
It happens not always it is difficult to know when it will happen next time.
When it happens all next queries with different paramOne values returns one object ignoring different paramOne values (which normally should return more than one objects). And this continues till you leave entity for some time not used. Or if change query (for example add additional parameter) it returns correct result.
Real queries from app (I execute additionally select with count(*)) :
First queries
select count(*) from RiksUser f WHERE upper(f.bo.riksUserName) like :riksUserName
riksUserName = %TEST1%
Returns 1 - thats ok
select f from RiksUser f WHERE upper(f.bo.riksUserName) like :riksUserName
riksUserName = %TEST1%
Returns 1 object - thats ok
Second queries
select count(*) from RiksUser f WHERE upper(f.bo.riksUserName) like :riksUserName
riksUserName = %TEST2%
Returns 2 - thats ok
select f from RiksUser f WHERE upper(f.bo.riksUserName) like :riksUserName
riksUserName = %TEST2%
Returns 1 object - thats ERROR
All those queries I execute on jboss-4.2.0.GA (EJB3).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4090899#4090899
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4090899
18Â years, 6Â months
[JBoss Seam] - Re: servlet functionality with seam component
by swd847
I was asking the same question not long ago. Here is an easy way to return a pdf from an action method (in this case a Jasper Report):
| byte[] data = JasperRunManager.runReportToPdf(compileDir
| + report.getReport() + ".jasper", params);
|
| FacesContext facesContext = FacesContext.getCurrentInstance();
| HttpServletResponse response = (HttpServletResponse) facesContext
| .getExternalContext().getResponse();
| response.setContentType("application/pdf");
| response.setContentLength(data.length);
| response.setHeader("Content-disposition",
| "attachment;filename=report.pdf");
|
| try {
|
| OutputStream out = response.getOutputStream();
|
| out.write(data);
|
| out.flush();
| out.close();
|
| facesContext.responseComplete();
| } catch (IOException ex) {
| FacesMessages.instance().add(
| "Error while downloading the file: report.pdf");
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4090891#4090891
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4090891
18Â years, 6Â months
[JBossWS] - JBossWS-2.0.1.GA SOAP 1.2 Web service Problem/issue
by govindaattal
Hi All,
I was creating Web service with SOAP 1.2 binding
bottom-up approach....
| @WebService(name="DLSOAP12Service", targetNamespace="ws.soap12.dlservice" )
| @SOAPBinding(style=SOAPBinding.Style.DOCUMENT)
| @BindingType(value="http://www.w3.org/2003/05/soap/bindings/HTTP/")
| public class DLSOAP12Service
| {
| public String echoString(String input)
| {
| return input;
| }
| }
|
In JBOSS when I looked at the corresponding WSDL in the list of registered service endpoints, I found that the binding with which web service was exposed was of SOAP 1.1
'http://schemas.xmlsoap.org/wsdl/soap/'
I later found from messages on conosle that though according to WSDL web service was exposed with SOAP 1.1 Binding it actually expected SOAP 1.2 envelopes in the messages.
|
| 11:14:58,791 WARN [SOAP12BindingJAXWS] Expected SOAP-1.2 envelope, but got: http://schemas.xmlsoap.org/soap/envelope/
|
|
When client invoked web service with messages in SOAP 1.2 envelopes JBOSS server cmd console didn't gave any warning messages...
Please correct if my observations can be disregarded.
When I created web service in a top-down approach using wsconsume task, it gave me following message
|
| C:\jboss-4.0.5.GA\bin>wsconsume.bat -k e:\SOAP12\DLServiceSOAP12.wsdl
| parsing WSDL...
|
|
| [WARNING] Ignoring SOAP port "DLServiceSOAP12": it uses non-standard SOAP 1.2 binding.
| You must specify the "-extension" option to use this binding.
| line 613 of file:/e:/SOAP12/DLServiceSOAP12.wsdl
|
| [WARNING] Service "DLServiceSOAP12" does not contain any usable ports. try running wsimport with -extension switch.
| line 611 of file:/e:/SOAP12/DLServiceSOAP12.wsdl
|
| generating code...
| ....
| ....
| ....
|
It didnot generate Webservice endpoint interface and client class at all! I was unable to figure out how should I put use of the 'WARNING' that wsconsume tool gave me!
Thanks & Regards,
Govinda Attal.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4090889#4090889
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4090889
18Â years, 6Â months