ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yuvraj Shinde" <Yuvraj.Shi...@sos.sungard.com>
Subject RE: Sybase - IBatis Null Pointer Error
Date Thu, 18 Jan 2007 16:15:39 GMT
Hi all,

 

  Please help me how to rollback transaction in ibatis.

 

   Even though AutoCommit value is set to false. Rollback of Transaction
is not working.

   I found one Issue in GeneralStatement.java.

   On line 52  request.getSession().setCommitRequired(true);  

 

   Here Autocommit is hardcoded it should be parameterized so that it
will take value from "Autocommit" property of  SqlMapConfig.xml.

   Please correct me if I am wrong.

 

Regards

Yuvrajs

 

 

 

________________________________

From: Christopher.Mathrusse@sybase.com
[mailto:Christopher.Mathrusse@sybase.com] 
Sent: Thursday, January 18, 2007 9:42 PM
To: jeffgbutler@gmail.com; user-java@ibatis.apache.org
Subject: RE: Sybase - IBatis Null Pointer Error

 

Yes, you remember correctly. That value, IGNORE_DONE_IN_PROC, will tell
ASE to only return the finally ResultSet and not all the others produced
during the execution of the sp. (Refer to the JConnect documentation)

 

Great memory Jeff!!

 

________________________________

From: "Jeff Butler" <jeffgbutler@gmail.com> [mailto:"Jeff Butler"
<jeffgbutler@gmail.com>] 
Sent: Thursday, January 18, 2007 7:32 AM
To: user-java@ibatis.apache.org
Subject: Re: Sybase - IBatis Null Pointer Error

You have every parameter delcared as input only - is that right?

 

Also, and I'm no ASE expert, I do remember something wierd about ASE
regarding a driver setting IGNORE_DONE_IN_PROC.  That might be worth
looking into.

 

Jeff Butler



 

On 1/17/07, aravind.duraipandi@jpmchase.com
<aravind.duraipandi@jpmchase.com > wrote: 


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,C
RE_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 

________________________________

 


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

 


Mime
View raw message