ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aravind.duraipa...@jpmchase.com
Subject Sybase - IBatis Null Pointer Error
Date Wed, 17 Jan 2007 16:29:33 GMT
Hi,
        We are Building a Project  where we use SYBASE and IBATIS. We are 
mapping the Objects Directly in the SQLMaps. Whenever i am doing an Select 
Statement inside the Stored Procedure i am getting back the Object. But 
When i have Insert Statement and then the Select Statement in the Stored 
Procedure a NULL Object is returned. We are getting a NULL PONTER 
Exception While trying to access the Object. I am not Sure why this is 
Happening. Can someone help me on this..



SQL Map has the Following


        <!--Procedure to Save in Transaction Master STARTS -->
        <resultMap id="saveTransactionResult" class="Transaction">
                <result property="transactionId" column="TXN_ID"/>
        </resultMap>

        <parameterMap id="saveTransactionParam"  class="Transaction">
                <parameter property="assetInformation.price" jdbcType = 
"INTEGER" javaType="java.lang.String" mode="IN"/>
                <parameter property="profile.profileId" jdbcType = 
"VARCHAR" javaType="java.lang.String" mode="IN"/>
                <parameter property="transactionType" jdbcType = "VARCHAR" 
javaType="java.lang.String" mode="IN"/>
                <parameter property="assetInformation.draftFlag" jdbcType 
= "VARCHAR" javaType="java.lang.String" mode="IN"/>
                <parameter property="account.accountNumber" jdbcType = 
"VARCHAR" javaType="java.lang.String" mode="IN"/>
                <parameter property="assetInformation.assetId" jdbcType = 
"VARCHAR" javaType="java.lang.String" mode="IN"/>
                <parameter property="userId" jdbcType = "VARCHAR" javaType
="java.lang.String" mode="IN"/>
        </parameterMap>

        <procedure id="SAVE_TRANSACTION" parameterMap =
"saveTransactionParam" resultMap="saveTransactionResult">
                { call sp_savetransaction(?,?,?,?,?,?,?) }
        </procedure>


The SP code is the Following


create proc sp_savetransaction1
        @P_TXN_AMOUNT_I varchar(20) ,
        @P_PRFL_ID_I varchar(20) , 
        @P_TXN_TYP_CD_I varchar(20) , 
        @P_DRAFT_FL_I   varchar(20) , 
        @P_ACCT_NB_I    varchar(20) , 
        @P_ASSET_ID_I   varchar(20) , 
        @P_LOG_USER_I   varchar(20) 
as 
        declare  @v_txn_axn_id int 
        declare  @v_txn_typ_id int 
        declare  @v_txn_sts_id int 
        declare  @v_txn_id int 
        declare  @v_txnwf_id int 
 
        --SELECT @P_TXN_TYP_CD_I AS 'YYYY'
 
        select @v_txn_typ_id = TXN_TYPE_ID from TXN_TYPE WHERE TXN_TYPE_CD 
=  @P_TXN_TYP_CD_I
 
        IF @P_DRAFT_FL_I = 'Y' 
                select   @v_txn_sts_id = TXN_STS_ID from TXN_STS WHERE 
TXN_STS_CD = 'DRFT'
        ELSE
                begin
                        select   @v_txn_axn_id = TXN_AXN_ID from 
TXN_ACTION_MASTER WHERE TXN_AXN_CD = 'INTD'
                        select   @v_txn_sts_id = TXN_STS_ID from TXN_STS 
WHERE TXN_STS_CD = 'INTD' 
                end 
 
        INSERT INTO TXN_MASTER
 
(TXN_TYPE_ID,TXN_STS_ID,PRFL_ID,TXN_DT,TXN_AMOUNT,DRFT_FLAG,CRE_USR_ID,CRE_USR_TS,UPDT_USR_ID,UPDT_TS,ACCT_NB

,ASSET_ID)
        VALUES
        (@v_txn_typ_id,@v_txn_sts_id ,cast(@P_PRFL_ID_I as int) 
,GETDATE(),cast(@P_TXN_AMOUNT_I as numeric),@P_DRAFT_FL_I 
,@P_LOG_USER_I,GETDATE(),NULL,NULL, @P_ACCT_NB_I,@P_ASSET_ID_I)
 
        SET @v_txn_id = @@IDENTITY
 
        IF @P_DRAFT_FL_I <> 'Y' 
                begin 
                                INSERT INTO TXN_WKFLW VALUES( @v_txn_id 
,@v_txn_axn_id 
,GETDATE(),@P_LOG_USER_I,NULL,@v_txn_axn_id,NULL,@P_LOG_USER_I,GETDATE(),NULL,NULL)
                end 
 
        SELECT @v_txn_id as TXN_ID
 
return

Please let me know how to proceed with this Error.


Regards,
Aravind Duraipandi
PCS ITS
Phone:(614)-213-4722
Email: Aravind.Duraipandi@jpmchase.com
Pager: 8773830942@skytel.com

<P><hr size=1></P><br>
<P><br>
This transmission may contain information that is privileged,<br>
confidential, legally privileged, and/or exempt from disclosure<br>
under applicable law.  If you are not the intended recipient, you<br>
are hereby notified that any disclosure, copying, distribution, or<br>
use of the information contained herein (including any reliance<br>
thereon) is STRICTLY PROHIBITED.  Although this transmission and<br>
any attachments are believed to be free of any virus or other<br>
defect that might affect any computer system into which it is<br>
received and opened, it is the responsibility of the recipient to<br>
ensure that it is virus free and no responsibility is accepted by<br>
JPMorgan Chase & Co., its subsidiaries and affiliates, as<br>
applicable, for any loss or damage arising in any way from its use.<br>
If you received this transmission in error, please immediately<br>
contact the sender and destroy the material in its entirety,<br>
whether in electronic or hard copy format. Thank you.<br>
</P>

Mime
View raw message