[JBoss jBPM] - Re: Getting SQLGrammarException when installing jBPM BPEL 1.
by alex.guizarï¼ jboss.com
The query looks good to me:
select
| job0_.ID_ as ID1_25_,
| job0_.VERSION_ as VERSION3_25_,
| job0_.DUEDATE_ as DUEDATE4_25_,
| job0_.PROCESSINSTANCE_ as PROCESSI5_25_,
| job0_.TOKEN_ as TOKEN6_25_,
| job0_.TASKINSTANCE_ as TASKINST7_25_,
| job0_.ISSUSPENDED_ as ISSUSPEN8_25_,
| job0_.ISEXCLUSIVE_ as ISEXCLUS9_25_,
| job0_.LOCKOWNER_ as LOCKOWNER10_25_,
| job0_.LOCKTIME_ as LOCKTIME11_25_,
| job0_.EXCEPTION_ as EXCEPTION12_25_,
| job0_.RETRIES_ as RETRIES13_25_,
| job0_.NAME_ as NAME14_25_,
| job0_.REPEAT_ as REPEAT15_25_,
| job0_.TRANSITIONNAME_ as TRANSIT16_25_,
| job0_.ACTION_ as ACTION17_25_,
| job0_.GRAPHELEMENTTYPE_ as GRAPHEL18_25_,
| job0_.GRAPHELEMENT_ as GRAPHEL19_25_,
| job0_.NODE_ as NODE20_25_,
| job0_.CLASS_ as CLASS2_25_
| from
| JBPM_JOB job0_
| where (job0_.LOCKOWNER_ is null
| or job0_.LOCKOWNER_=?)
| and job0_.RETRIES_>0
| and job0_.DUEDATE_<=?
| and job0_.ISSUSPENDED_<>1
| order by job0_.DUEDATE_ asc
so the problem must lie in the combination of database, JDBC driver and Hibernate dialect. Use org.hibernate.dialect.OracleDialect for Oracle 8 and earlier, org.hibernate.dialect.Oracle9Dialect for Oracle 9 and 10. If you are already doing so, please tell us your database/driver versions and connection settings.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4028928#4028928
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4028928
19Â years, 1Â month
[JBoss Seam] - Re: @Factory and @DataModel on the same method
by fabricio.lemos
"fabricio.lemos" wrote : "petemuir" wrote : This is bad idea. How is Seam to know whether you want a DataModel or a List when you access the useCaseList context variable?
|
| It really makes sense. Thank you.
I was looking on others datamodels that I have and got I little more confusing. I found this method:
| @DataModel
| public List<Step> getStepList(){
| return useCase.getSteps();
| }
|
And the dataTable that reads the DataModel:
| <h:dataTable value="#{stepList}" var="stepVar">
| <h:column>
| <f:facet name="header">Name</f:facet>
| #{stepVar.name}
| </h:column>
| <h:column>
| <f:facet name="header">Edit</f:facet>
| <h:commandLink value="Edit" action="updateStep" />
| </h:column>
| </h:dataTable>
|
I do not know how Seam knows if it is a DataModel or a List when stepList is accessed, but it works pretty fine, also injecting the selected entity through a @DataModelSelection annotation.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4028920#4028920
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4028920
19Â years, 1Â month
[EJB 3.0] - @sqlResultMapping - ClassCastException
by lydiachung
I set up a SqlResultMapping for the User entity.
@SqlResultSetMapping(name="User", entities={
| @EntityResult(entityClass=User.class, fields = {
| @FieldResult(name="userid", column="userid"),
| @FieldResult(name="username", column="username")
| })}
| )
| @NamedNativeQuery(name="GetUsers",
| query="select userid, username from user",
| resultSetMapping="User")
Then I want to query the a list of users.
List userList = em.createNamedQuery("GetUsers").getResultList();
It returns me a list of objects and when I tried to cast the object to User, it throws ClassCastException.
User user = (User) userList.get(0)
Is there a way that I can get User class type back?
Thanks,
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4028916#4028916
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4028916
19Â years, 1Â month
[Persistence, JBoss/CMP, Hibernate, Database] - Trying to understand odd behavior in nested queries/result s
by aguita
Hi everyone,
I am working for a company that is using a data warehouse to store information. There are times where it is impossible to join various tables due to the nature of tracking the history of how things change.
I am using jboss-4.0.3SP1 and the CMP contained within, as well as JDK 1.4.2 (Forced to stay at 1.4 until third party vendors upgrade). We are on Oracle 9i using the classes12.zip. The oracle-ds.xml file uses the <local-tx-datasource> setup.
I grab the connection from the CMP pool per normal method:
| InitialContext initialContext = new InitialContext();
| this.ds = (javax.sql.DataSource) initialContext
| .lookup("java:jdbc/reportsDS");
|
psuedo logic:
| initial Method(){
| try{
| loop through initial query:
| get various pieces of info from the DB
| getMoreInformation(pass PK)
| end loop
| }
| catch() {
| }
| finally {
| close things up
| }
| }
|
| getMoreInformation(ForeignKey){
| try {
| executeQuery
| loop through query:
| Get the PKs associated with the FK.
| getDetailOnPrimaryKey();
| end loop
| }
| catch() {
| }
| finally {
| close things up
| }
| }
|
| getDetailOnPrimaryKey(PK){
| try{
| exectueQuery
| get results
| }
| catch() {
| }
| finally {
| close things up
| }
| }
|
Now, what this does is essence creates 3 active result sets, and gets all the details necessary and then finishes things up.
For whatever reason, the third active result set causes problems. I and three others have verified that every instance grabs a connection from the pool, then closes the connection, returning it to the pool within the finally block surrounding the code. Yet, when it is run, the CMP pool opens up new connections only when the third result set is then used, even if there are available connections in the pool. Basically, it looks like it is duplicating the entire pool at that stage. Eventually, the max size for the pool is reached, and the CMP can not open a new connection. What is really strange as well, is even though all connections as stated in the Oracle Enterprise Manage as being inactive, are not being used, and the pool can not open any more connections ... the entire web site stops working!
We have tried many different things, and have fixed it the problem by completely eliminating the RS within a RS idea: loop through the first RS, and store the results in a list, then go over the list to do the sub-selects.
So the question to you all is:
1. Is the RS within a RS just a bad design/code?
2. If the RS within a RS is a bad design/code, what would you suggest instead? IS there a more elegant way of doing things?
3. What would cause the pool to be duplicated in the situation as indicated above?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4028912#4028912
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4028912
19Â years, 1Â month