InterviewSolution
| 1. |
Explain The Difference Between Settrans() And Settransobject()? |
|
Answer» SetTransObject() works faster because it doesn’t perform Connect and Disconnect each time we call it. When we specify SetTrans() system Does all TRANSACTION Automatically. When we specify SetTransObject() we have to manage all Transaction by ourselves. When we use SetTrans( ) in a script, the DataWindow uses its internal transaction object and automatically connects and DISCONNECTS as needed; any errors that occur CAUSE an automatic ROLLBACK. Use SetTrans() when we WANT PowerBuilder to manage the database connections automatically because we have a limited number of available connections or will be used the application from a remote location. SetTrans() is appropriate when we are only retrieving data and do not need to hold database locks on records the user is modifying. However, for better performance, we should use SetTransObject(). SetTransObject() works faster because it doesn’t perform Connect and Disconnect each time we call it. When we specify SetTrans() system Does all transaction Automatically. When we specify SetTransObject() we have to manage all Transaction by ourselves. When we use SetTrans( ) in a script, the DataWindow uses its internal transaction object and automatically connects and disconnects as needed; any errors that occur cause an automatic rollback. Use SetTrans() when we want PowerBuilder to manage the database connections automatically because we have a limited number of available connections or will be used the application from a remote location. SetTrans() is appropriate when we are only retrieving data and do not need to hold database locks on records the user is modifying. However, for better performance, we should use SetTransObject(). |
|