-
1. Re: run method in a transaction?
aloubyansky Oct 3, 2002 10:55 AM (in response to schneider)Are you calling finder and then iterate through the results?
RequiresNew doesn't help here. Because the rows chached will be lost as soon as the transaction completes, i.e. finder successfully returns.
The part that includes finder and iteration should be one transaction to make use of preloading data. -
2. Re: run method in a transaction?
schneider Oct 3, 2002 12:01 PM (in response to schneider)I iterate through the result in the function 'convertFromEntityBeanListToAccountValueListLocal' (see above), but I think this is in the same transaction like 'findAll' (or not??).
The client iterates through the converted List (ValueObjects), do this have any effect to the server??
here is the code of the function 'convertFromEn....' perhaps there is an error I don't see:
/**
* Convert Collection of Entity beans to an ArrayList of Value Objects
* used for local beanlist
*
* @todo optimize (use local interfaces)
* @todo throw better exception
*/
public static java.util.ArrayList convertFromEntityBeanListToAccountValueListLocal(java.util.Collection entityBeanList)
throws Exception
{
java.util.ArrayList result = new java.util.ArrayList (entityBeanList.size ());
java.util.Iterator entityIt;
com.vescon.aum.server.iface.masterdata.AccountLocal entity;
entityIt = entityBeanList.iterator();
while (entityIt.hasNext())
{
entity = (com.vescon.aum.server.iface.masterdata.AccountLocal) entityIt.next();
result.add (entity.getAccountValue ());
}
return result;
}
do this function also need a transaction tag??
best regards,
rudi -
3. Re: run method in a transaction?
aloubyansky Oct 3, 2002 12:30 PM (in response to schneider)>I iterate through the result in the function
> 'convertFromEntityBeanListToAccountValueListLocal'
> (see above), but I think this is in the same
> transaction like 'findAll' (or not??).
The same, unless findAll marked as RequiresNew.
>The client iterates through the converted List
>(ValueObjects), do this have any effect to the server??
When getAccountValue() is called container checks whether the needed fields are already loaded and if not, then it loads them.
Sorry, don't have ideas for now. -
4. Re: run method in a transaction?
schneider Oct 4, 2002 9:28 AM (in response to schneider)I tried some more variants of tags.
After setting the transaction-tags at the right positions AND defining a @jboss.read-ahead tag for the AccountBean it works!!
--> read-ahead works, unoptimized do not!?
I now use read-ahead (like I would do from the begining).
thanks for all your answers,
rudi