Hi
  In the code you sent you have said  in the begining
     [conection_name].commit();

why would you want to commit in the begining itself before performing the
database operation.

1. set autocommit to false;
2. perform the database operation
3. commit if it is successful or if there is a SQLException then Rollback

revert if I am wrong

thanks
regards
Sanjeevi
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material.  Any review, retransmission,  dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited.   If you received
this in error,  please contact the sender and delete the material from any
computer.
-- Phoenix Global Solutions (India) Pvt Ltd., www.pgsolutions.com
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


                                                                                       
                               
                    "Sergio Moreno"                                                    
                               
                    <smoreno@previsi        To:     JRun-Talk 
<[EMAIL PROTECTED]>                           
                    on.com.bo>              cc:                                        
                               
                                            Subject:     Transaction Problem           
                               
                    12/20/2001 12:41                                                   
                               
                    AM                                                                 
                               
                    Please respond                                                     
                               
                    to jrun-talk                                                       
                               
                                                                                       
                               
                                                                                       
                               




Hi:

Does anybody know what is the mistake here?

i'm using the Connection object to start a transaction using :
[conection_name].commit();
[conection_name].setAutoCommit(false);
try
{
.
PreparedStatement1.executeUpdate();
PreparedStatement2.executeUpdate();
[conection_name].commit();
.
}
catch (SQLException e)
{
[conection_name].rollback();
}

then shows the error "Invalid Cursor State"
by the way the driver is com.ibm.as400.access.AS400JDBCDriver
and i use the datasource model to obtain the connecction
Sergio Moreno V.
AFP PREVISION * BBV

______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to