ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niels Beekman" <n.beek...@wis.nl>
Subject RE: Parameters to store procedure
Date Mon, 04 Sep 2006 11:01:34 GMT
Change #usedId# to #userId#, maybe the CDATA causes trouble too, but I'm not sure about that


-----Original Message-----
From: Javier Leyba [mailto:xleyba@gmail.com] 
Sent: maandag 4 september 2006 10:47
To: user-java@ibatis.apache.org
Subject: Re: Parameters to store procedure

On 9/2/06, Jeff Butler <jeffgbutler@gmail.com> wrote:
> iBATIS resultMap/resultClass objects are only used for result sets.  Since
> your procedure does not return a result set, they will not work.
> In your case, since you are using a Map as a parameter object, the result
> should be available in the Map after you call the procedure.


Thanks for your reply.

I've changed my map to this:

<procedure id="deleteUserNotification" parameterClass="java.util.Map">

In my program I did:

// to check if I'm receiving parameters ok.
if (logger.isDebugEnabled()) {
	logger.debug("---- deleteUserNotification(String, Integer)");
	logger.debug("---- userId: 			" + userId);
	logger.debug("---- notificationId: 	" + notificationId);

SqlMapClient sqlMap = NotificationsSqlConfig.getSqlMapInstance();
Map m = new HashMap();
m.put("userId", userId);
m.put("notificationId", notificationId);
m.put("result", null);
Map qm = sqlMap.queryForMap("deleteUserNotification", m, "result");
logger.info("---- qm: " + qm.toString());	


Then in my log I can see my program received parameters ok:

2006-09-04 10:34:00,324 :INFO
deleteUserNotification(String, Integer) - start
2006-09-04 10:34:00,325 :DEBUG
:[http-]:sPortSoapBindingImpl: ----
deleteUserNotification(String, Integer)
2006-09-04 10:34:00,326 :DEBUG
:[http-]:sPortSoapBindingImpl: ---- userId: javier
2006-09-04 10:34:00,327 :DEBUG
:[http-]:sPortSoapBindingImpl: ---- notificationId:
2006-09-04 10:34:00,327 :DEBUG


but I enabled ibatis.sql.debug and I see the following:

2006-09-04 10:34:01,713 :DEBUG
:[http-]:taCommonsLoggingImpl: {pstm-100001} Executing
Statement: {call deleteUserNotification(?,?,?)}
2006-09-04 10:34:01,743 :DEBUG
:[http-]:taCommonsLoggingImpl: {pstm-100001} Parameters:
[null, 1, null]
2006-09-04 10:34:01,744 :DEBUG
:[http-]:taCommonsLoggingImpl: {pstm-100001} Types:
[null, java.lang.Integer, null]

where parameters appear as null values...

The query keeps doing nothing and my client program waiting for a
reply without success...

My store procedure is:

CREATE PROCEDURE `DeleteUserNotification`(sUserId VARCHAR(255),
iNotificationId INTEGER(11), OUT result INTEGER(11))
    COMMENT ''
     DELETE FROM user_notification
     WHERE user_notification.notification_id = sUserId
     AND user_notification.user_id = iNotificationId;

     SELECT ROW_COUNT() into result;

and it work well from a SQL console...

What´s wrong ?

Thanks in advance

Javier Leyba
Barcelona - Spain

View raw message