[EJB 3.0] - entityManager.find() returns null
by tboswell
I am using JBoss 4.0.4-GA with Oracle XE. I have two tables which have strings for their PK and the PK column is named the same as the table:
| CREATE TABLE CURRENCY
| (
| CURRENCY CHAR(8 CHAR) NOT NULL,
| ...
| )
|
| CREATE TABLE LANGUAGE
| (
| LANGUAGE CHAR(8 CHAR) NOT NULL,
| ...
| )
|
This is not ideal I know but it was what I was given to work with.
I find that when using the corresponding entity beans if I use the code:
entityManager.find(Language.class, "en");
this will return me a null value despite the row existing.
This is not a problem when using other entity manager functions A query like entityManager.createQuery("from Language l").getResultList(); will run fine and result all the expected results.
If I call the same code from a test case which is wrapped within a single transaction, I can create an object, insert it and run the same code within the transaction and find it OK.
Only when I am trying to find records already existing outside the transaction do I get the problem.
With DEBUG I have checked the query that Hibernate runs and this runs fine in Oracle but still returns a null to me within my session bean code.
| select language0_.LANGUAGE as LANG1_73_0_, language0_.NAME as NAME73_0_, language0_.SHORT_NAME as SHORT3_73_0_, language0_.CREATED as CREATED73_0_, language0_.INSERTED as INSERTED73_0_, language0_.MODIFIED as MODIFIED73_0_, language0_.ENABLED as ENABLED73_0_, language0_.ENABLED_DATE as ENABLED8_73_0_, language0_.COMMENTS as COMMENTS73_0_, language0_.TESTED as TESTED73_0_, language0_.SUPPORTED as SUPPORTED73_0_, language0_.TESTED_DATE as TESTED12_73_0_, language0_.SUPPORTED_DATE as SUPPORTED13_73_0_, language0_.DEFAULT_TO_LANGUAGE as DEFAULT14_73_0_ from LANGUAGE language0_ where language0_.LANGUAGE='en';
|
I have tried several permutations of changing the table and PK column names but to no avail. For example change the PK name I get this query
| select language0_.LANG_CODE as LANG1_73_0_, language0_.NAME as NAME73_0_, language0_.SHORT_NAME as SHORT3_73_0_, language0_.CREATED as CREATED73_0_, language0_.INSERTED as INSERTED73_0_, language0_.MODIFIED as MODIFIED73_0_, language0_.ENABLED as ENABLED73_0_, language0_.ENABLED_DATE as ENABLED8_73_0_, language0_.COMMENTS as COMMENTS73_0_, language0_.TESTED as TESTED73_0_, language0_.SUPPORTED as SUPPORTED73_0_, language0_.TESTED_DATE as TESTED12_73_0_, language0_.SUPPORTED_DATE as SUPPORTED13_73_0_, language0_.DEFAULT_TO_LANGUAGE as DEFAULT14_73_0_ from LANGUAGE language0_ where language0_.LANG_CODE='en';
|
But the same result.
Is there something I am doing here that Hibernate doesn't expect or is there a known bug?
Thanks,
Tom Boswell
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972537#3972537
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972537
19 years, 7 months
[JBoss jBPM] - Re: BPEL workflow - who to determine whats the next step?
by KVAK_TNT
Thanks Alex for your answer!
It was very helpful. But as allways - I have more questions:
OK - You talked about ticketnumbers.
OK that's the way I wanted to work anyway. But isn't there allready a ticketnumber (processcontext) saved in database?
Lets describe it by an example:
I have started a process like a "bulk purchase".
I have delayed this process - maybe because I'm not allowed to do any tasks further (like commiting an order because it exeeds an special amount of money).
As a next point my supervisor gets an information to continue the process and commit the order.
So heres the point.
I want to create (use) a unique ticket id and store it in the (the same or another) database. In my example my superviser would use this ticket id to connect to the webservice and continue the process with the another authorisation access.
Easy isn't it?
So and now the BIG question I'm hanging arround:
Is something like this (unique ticket id) that I can access via my BPEL-Processmodelling or my Implementations in my "back" to work like in the example?
I know there was something like this in jBPM (process instances?)
Every help is welcome!
Greetings
Claus
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972536#3972536
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972536
19 years, 7 months
[JBoss Seam] - Seam booking example doesn't work correctly
by michalt
I set up the Seam configuration according to "Getting started" guide. I installed Seam 1.0.1.GA and Jboss 4.0.4.GA from JEMS 1.2.0.BETA installer. I run Eclipse examples (sample and blank) from Getting Started guide. Next, I tried to run the Seam booking example. The application compiles and deploys correctly without any errors in the server log. I can register, log in and search for hotels. However, when I click on "View Hotel" link, the application shows View Hotel page which has empty hotel data fields (name, address, city, state, zip, country). The "Workspaces" area shows only "View hotel: [current]" and time.
If I try to book hotel anyway, the applications lets me fill the booking page and go to "Confirm" page. This page, however, shows no hotel data and in the "Workspaces" area shows: "Confirm: null, 2006-09-19 to 2006-09-20 [current]".
If I click on "Confirm" button, the application fails fails with the following Tomcat exception:
javax.servlet.ServletException: Error calling action method of component with id _id16:_id22
I also run the application with seam debug page. The debug page shows that even though the hotel is selected correctly, the hotel component has null value. This is a very strange behaviour and I really don't know what to do next. Maybe there is some subtle configuration error, but I can't find it.
Maybe someone here will have some suggestions how to solve or debug this ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972530#3972530
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972530
19 years, 7 months