Yes !!!
They have made it.

LocalHome interface:

  |     ...
  |      public Collection findPaysSum( Timestamp time1, Timestamp time2) throws 
FinderException;
  |     ...
  | 
ejb-jar.xml:

  |     ...
  |    <ejb-ql>
  |        [CDATA[
  |            SELECT SUM(p.summa) FROM pay p WHERE p.moment > ?1 and p.moment < ?2
  |         ]]
  |    </ejb-ql>
  |     ...
  | 

Use this method:

  |     ...
  |     Iterator it = payHome.findPaysSum( Timestamp.valueOf( time1), 
Timestamp.valueOf( time2)).iterator();
  |      if( it.hasNext()){
  |             Object pk = ( ( EJBLocalObject)it.next()).getPrimaryKey();
  |              return ( Double)pk;
  |      }
  |     ...
  | 

But if the result of SUM function is null, this method throws the Exception:
javax.ejb.TransactionRolledbackLocalException: Attempt to get lock ref with a null 
object; CausedByException is: Attempt to get lock ref with a null object

How it is possible to bypass it?

Thanks



View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3840234#3840234

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3840234


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to