summaryrefslogtreecommitdiff
path: root/cpp/demo/Database/Oracle/occi/OCCIServantLocator.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2010-02-11 05:10:43 +0100
committerJose <jose@zeroc.com>2010-02-11 05:10:43 +0100
commitd3e520a951ced49d836e94936451a529d301e562 (patch)
tree366f383dbc98a8fb3c2e2744c6581736aa4cd034 /cpp/demo/Database/Oracle/occi/OCCIServantLocator.cpp
parentbug 4380: stringToProxy docu (diff)
downloadice-d3e520a951ced49d836e94936451a529d301e562.tar.bz2
ice-d3e520a951ced49d836e94936451a529d301e562.tar.xz
ice-d3e520a951ced49d836e94936451a529d301e562.zip
4651 - Inconsistent line endings
Diffstat (limited to 'cpp/demo/Database/Oracle/occi/OCCIServantLocator.cpp')
-rw-r--r--cpp/demo/Database/Oracle/occi/OCCIServantLocator.cpp144
1 files changed, 72 insertions, 72 deletions
diff --git a/cpp/demo/Database/Oracle/occi/OCCIServantLocator.cpp b/cpp/demo/Database/Oracle/occi/OCCIServantLocator.cpp
index 58c4148376c..51a014dfb2a 100644
--- a/cpp/demo/Database/Oracle/occi/OCCIServantLocator.cpp
+++ b/cpp/demo/Database/Oracle/occi/OCCIServantLocator.cpp
@@ -6,75 +6,75 @@
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
-
-#include <OCCIServantLocator.h>
-#include <EmpI.h>
-#include <DeptI.h>
-#include <DbTypes.h>
-#include <Util.h>
-#include <occi.h>
-
-using namespace std;
-using namespace oracle::occi;
-
-OCCIServantLocator::OCCIServantLocator(const DeptFactoryIPtr& factory) :
- _factory(factory)
-{}
-
-
-Ice::ObjectPtr
-OCCIServantLocator::locate(const Ice::Current& current, Ice::LocalObjectPtr& cookie)
-{
- ConnectionHolderPtr con = new ConnectionHolder(_factory->getConnectionPool());
- RefAny ref = decodeRef(current.id.name, _factory->getEnv(), con->connection());
-
- try
- {
- //
- // Extract SQL type from target object
- //
- string sqlType = Ref<PObject>(ref)->getSQLTypeName();
-
- //
- // Create and return the servant, used only for this one operation
- //
- if(sqlType.find("EMP_T") != string::npos)
- {
- return new EmpI(ref, con, _factory);
- }
- else if(sqlType.find("DEPT_T") != string::npos)
- {
- return new DeptI(ref, con, _factory);
- }
- else
- {
- return 0;
- }
- }
- catch(const SQLException& sqle)
- {
- if(sqle.getErrorCode() == 21700)
- {
- return 0;
- }
- else
- {
- throw;
- }
- }
-}
-
-void
-OCCIServantLocator::finished(const Ice::Current&, const Ice::ObjectPtr&, const Ice::LocalObjectPtr&)
-{
- //
- // Nothing to do: if the connection was not yet released, it is released (and the tx rolled back)
- // when the servant's last refcount goes away
- //
-}
-
-void
-OCCIServantLocator::deactivate(const string&)
-{
-}
-
+
+#include <OCCIServantLocator.h>
+#include <EmpI.h>
+#include <DeptI.h>
+#include <DbTypes.h>
+#include <Util.h>
+#include <occi.h>
+
+using namespace std;
+using namespace oracle::occi;
+
+OCCIServantLocator::OCCIServantLocator(const DeptFactoryIPtr& factory) :
+ _factory(factory)
+{}
+
+
+Ice::ObjectPtr
+OCCIServantLocator::locate(const Ice::Current& current, Ice::LocalObjectPtr& cookie)
+{
+ ConnectionHolderPtr con = new ConnectionHolder(_factory->getConnectionPool());
+ RefAny ref = decodeRef(current.id.name, _factory->getEnv(), con->connection());
+
+ try
+ {
+ //
+ // Extract SQL type from target object
+ //
+ string sqlType = Ref<PObject>(ref)->getSQLTypeName();
+
+ //
+ // Create and return the servant, used only for this one operation
+ //
+ if(sqlType.find("EMP_T") != string::npos)
+ {
+ return new EmpI(ref, con, _factory);
+ }
+ else if(sqlType.find("DEPT_T") != string::npos)
+ {
+ return new DeptI(ref, con, _factory);
+ }
+ else
+ {
+ return 0;
+ }
+ }
+ catch(const SQLException& sqle)
+ {
+ if(sqle.getErrorCode() == 21700)
+ {
+ return 0;
+ }
+ else
+ {
+ throw;
+ }
+ }
+}
+
+void
+OCCIServantLocator::finished(const Ice::Current&, const Ice::ObjectPtr&, const Ice::LocalObjectPtr&)
+{
+ //
+ // Nothing to do: if the connection was not yet released, it is released (and the tx rolled back)
+ // when the servant's last refcount goes away
+ //
+}
+
+void
+OCCIServantLocator::deactivate(const string&)
+{
+}
+