[EJB 3.0] - Bug in EJBQL with MSSQL?
by jeffreybozek
Is there a translation problem in EJBQL with the DISTINCT construct and MSSQL? I have a query:
| SELECT DISTINCT OBJECT(a) FROM Account a LEFT JOIN a.lastAccountActivity laa JOIN a.territory t JOIN t.collectors c JOIN c.team tm JOIN tm.supervisors s WHERE s.employee.username = :username ORDER BY laa.time ASC, a.accountNumber
|
This works fine in MySQL and returns as list of distinct Account objects (that are in some way related to me as an employee with "supervisor" role) sorted by the time field on the Account.lastAccountActivity object.
When I run this query against MSSQL I get the following error:
anonymous wrote :
| Preparing the statement failed: ORDER BY items must appear in the select list if SELECT DISTINCT is specified.
|
I'm using the correct MSSQL dialect for the hibernate settings.
Here is the issue:
I'm using an older version of the EJB3 spec (the first public draft from June 2005). Since I know that the first reponse will be to migrate to a more recent release: Does anyone know if this is resolved in the more recent releases?
Thanks!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012646#4012646
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012646
19Â years, 2Â months
[JBoss Seam] - Re: Issues moving from Seam 1.1.0 to Seam 1.1.5
by SmokingAPipe
Call me old fashioned but I'm in the camp that says that the logging system should be brain-dead-simple and should never cause errors and should always work. It exists to debug and diagnose other problems. I shouldn't have to debug and diagnose it.
Now, what's happening here is we need TWO different views of logging: One is "software diagnostic" logging, so I can trace when certain pieces of code trigger and send myself messages. The other level is "application monitoring" logging, where the application itself generates messages that are relevant to application users.
Let's take an MTA as an example. A "software diagnostic" level might be something like, "fatal error: attempting to free() a null pointer". That tells me, I've made a software mistake, in the logic. A "application monitoring" message would be, "mail delivered successfully to..." or perhaps, "unable to bind to port 25; check to see if some other process is binding to that port." Do you see the difference?
What has happened unfortunately is that the Java community has not understood the difference. We have these sophisticated logging frameworks that do a lot of things, but as we can see in this thread, they aren't bulletproof and they can and do cause their own problems. This makes them bad for the software level logging I'm talking about. Software level logging should focus on working 100% of the time. That's why I always use java.util.logging for this, because it has no external jar dependencies, meaning that no matter what is going on with jars and classloaders, it will still always work. That's how a software logging tool should be.
For the application-level logging, external dependencies are fine. In my current Seam application, I actually have a logging MDB that various components use to send messages that users can then view through the web page. That's cool but it's high level and fragile; it stops working if I make a config mistake, or have the wrong jar, or messages aren't working for whatever reason.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012642#4012642
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012642
19Â years, 2Â months