ClearMyBench
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Ruby concepts part 2 (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Ruby concepts part 2
#4660
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby concepts part 2 3 Years, 10 Months ago Karma: 0  
Disconnecting Database

To disconnect Database connection, use disconnect API.


The syntax is

dbh.disconnect
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4661
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby concepts part 2 3 Years, 10 Months ago Karma: 0  
If the connection to a database is closed by the user with the disconnect method, any outstanding transactions are rolled back by the DBI.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4662
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby concepts part 2 3 Years, 10 Months ago Karma: 0  
However, instead of depending on any of DBI's implementation details, our application would be better off calling commit or rollback explicitly.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4663
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby concepts part 2 3 Years, 10 Months ago Karma: 0  
Handling Errors

There are many sources of errors.
A few examples are a syntax error in an executed SQL statement, a connection failure, or calling the fetch method for an already canceled or finished statement handle.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4664
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby concepts part 2 3 Years, 10 Months ago Karma: 0  
If a DBI method fails, DBI raises an exception.

DBI methods may raise any of several types of exception but the two most important exception classes are

1.DBI::InterfaceError

2. DBI:atabaseError.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4665
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby concepts part 2 3 Years, 10 Months ago Karma: 0  
Exception objects of these classes have three attributes named err, errstr, and state, which represent the error number, a descriptive error string, and a standard error code.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
get the latest posts directly to your desktop
logo footer   Copyright 2009 - 2013 HotRecruiter.Com - All Rights Reserved