The method is perhaps not being run within a transaction since this behaviour
is typical of such.  To get all the results in one query override with
jboss-ql and use a 'strategy' of on find. All this is discussed in the
JBOSSCMP user guide.
Lawrence
Rafal Kedziorski wrote:

> Hi,
>
> my every entity beas has findAll() method defined in ejb-jar.xml as follow:
>
> <query>
>   <query-method>
>     <method-name>findAll</method-name>
>       <method-params/>
>   </query-method>
>   <ejb-ql><![CDATA[SELECT OBJECT(o) FROM firm o]]></ejb-ql>
> </query>
>
> Could be this done better by other mechanism? JBoss are generating this
> query for PostgreSQL:
>
> // get all id's
> LOG:  query: SELECT t0_o.firm_id FROM firm t0_o
>
> // call for every id
> LOG:  query:
> SELECT firm_id,name FROM firm WHERE (firm_id=1) OR (firm_id=2) OR
> (firm_id=1046258766552575) OR (firm_id=1046258766812847) OR
> (firm_id=1046258766781998) OR (firm_id=1046258766823725) OR (
> firm_id=1046258766815290) OR (firm_id=1046258766821931) OR
> (firm_id=1046258766808355) OR (firm_id=1046258766805899) OR
> (firm_id=1046258766840567) OR (firm_id=1046258766818653) OR
> (firm_id=1046258766857549) OR (firm_id=1046258766870043)
>
> ...
>
> LOG:  query: SELECT firm_id,name FROM firm WHERE
> (firm_id=1046258766821931) OR (firm_id=1046258766808355) OR
> (firm_id=1046258766805899) OR (firm_id=1046258766840567) OR
> (firm_id=1046258766818653) OR (
> firm_id=1046258766857549) OR (firm_id=1046258766870043)
>
> ...
>
> LOG:  query: SELECT firm_id,name FROM firm WHERE
> (firm_id=1046258766818653) OR (firm_id=1046258766857549) OR
> (firm_id=1046258766870043)
>
> ...
>
> LOG:  query: SELECT firm_id,name FROM firm WHERE
> (firm_id=1046258766857549) OR (firm_id=1046258766870043)
>
> ...
>
> // last sql query
> LOG:  query: SELECT firm_id,name FROM firm WHERE (firm_id=1046258766870043)
>
> why are sending JBoss not for every firm_id one query?
>
> I have other tables, where are stored much more values. which generate
> than longer query.
>
> Best Regards,
> Rafal
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Scholarships for Techies!
> Can't afford IT training? All 2003 ictp students receive scholarships.
> Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
> www.ictp.com/training/sourceforge.asp
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user

-- 
****************************************************************************

MX Financial Solutions is a trading name of MX Moneyextra Financial
Solutions Ltd, which is regulated by the Financial Services Authority and a
member of the General Insurance Standards Council.

MX Moneyextra Financial Solutions Ltd is registered in England No. 3379907.

Registered Office: One Temple Back East, Temple Quay, Bristol BS1 6DX
A wholly owned subsidiary of Bristol & West plc.

****************************************************************************


-------------------------------------------------------
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to