Solution: An unhandled exception of Type 'System. exception' occurred in system. Data. oraclec

Source: Internet
Author: User

//************************************** **************************************** *********//
An unhandled exception of Type 'System. exception' occurred in system. Data. oracleclient. dll

Additional information: Internal pooler error: 2

//************************************** **************************************** *********//

'''-----------------------------------------------------------------------------
''' <Summary>
'''Do all insert/update data in CAN rollback persistence
''' </Summary>
'''2007/6/26 created
''' </History>
Public sub setinsertupdatedatainpersistence (byval dT as datatable)
Log. Info ("call ")
Try
Persistence = new persistencefactory (). createinstance ()
'Persistence = factory. createinstance
'The initial state of affairs
Persistence. begintrans ()
For each Dr as datarow in DT. Rows
'Update settings (1/7)
Me. setupdatedata_no1 (DR)
'Update settings (2/7)
Me. setupdatedata_no2 (DR)
'Update settings (3/4/7)
Me. setupdatedata_no3andno4 (DR)
'Update settings (5/6/7)
Me. setupdatedata_no5andno6 (DR)
'Update settings (7/7)
Me. setupdatedata_no7 (DR)
Next
Persistence. Commit ()
Catch ex as exception
Persistence. rollback ()
Log. Fatal (ex. tostring)
Throw (Ex)
'Finally
'If not (persistence is nothing) then
'Persistence. Close ()
'End if
End try
Log. Info ("end ")
End sub

the above is a batch-processed operation. If an error exists, you must perform the rollback operation.
the quotation mark is used to solve the Code .
that is to say, after the database operation is completed, the operation source for this transaction must be disabled.
otherwise, the above strange error occurs.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.