-
1. Attaching EAR file
sdmb Nov 20, 2002 5:14 PM (in response to sdmb)If this is any help finding a solution...
-
2. Other JBoss build behavior
sdmb Nov 20, 2002 9:13 PM (in response to sdmb)JBoss 3.2.0beta -- same error
JBoss 3.0.3 -- same error
JBoss 3.0.0 -- works as expected -
3. Spoke too soon on JBoss 3.0.0
sdmb Nov 20, 2002 9:49 PM (in response to sdmb)JBoss 3.0.0 also shows this behavior. Obviously I am missing something when it comes to CMR and transactional integrity.
How do I close a transaction, when I am not aware of having started one? This is very frustrating. -
4. Re: Spoke too soon on JBoss 3.0.0
bleupen Nov 21, 2002 9:44 AM (in response to sdmb)Hey,
the getAccounts() CMR method probablyu started its own transaction b/c your Servlet did not.
you need to convert the CMR Collection into a collection of entities. For example:
public static Collection convert(Collection col, Class cls)
{
Collection results = new ArrayList();
Object[] ouArray = (Object[])col.toArray((Object[])Array.newInstance(cls,new int[]{0}));
results = Arrays.asList(ouArray);
return results;
} -
5. Re: Spoke too soon on JBoss 3.0.0
sdmb Nov 26, 2002 3:47 AM (in response to sdmb)Thanks for the response!
How can I simply keep getAccounts() CMR method from starting its own transaction? I will have to try your method of tricking out the data. -
6. Re: Spoke too soon on JBoss 3.0.0
scoy Nov 26, 2002 5:53 AM (in response to sdmb)You need to do some research into fundamental J2EE patterns. Have a look at http://www2.theserverside.com/home/index.jsp for starters.
In essence, you need to write a session bean that provides services to your servlet.
One of these services would be to return a collection of account data (not necessarily the entities themselves) related to a particular bank.
The strength of this is it allows you to use container managed transactions (which is way easier than doing your own transaction management) and perform all the "heavy" work using local interfaces.
Steve Coy -
7. Re: Spoke too soon on JBoss 3.0.0
sdmb Nov 26, 2002 3:00 PM (in response to sdmb)Thanks. I was doing the "session" providing access in other applications, but I guess I didn't realise the transaction-goodness it provided behind the scenes. This is exactly what I was looking for.