diff --git a/castor/tape/tapegateway/daemon/ITapeGatewaySvc.hpp b/castor/tape/tapegateway/daemon/ITapeGatewaySvc.hpp index 312d1ae006d9396ae6b155e30bc2ad2f4d6f639e..a21682c3aa3b59ad58f6b1ef93e0fef94589e049 100644 --- a/castor/tape/tapegateway/daemon/ITapeGatewaySvc.hpp +++ b/castor/tape/tapegateway/daemon/ITapeGatewaySvc.hpp @@ -174,12 +174,14 @@ namespace castor { castor::tape::tapegateway::ITapeGatewaySvc::TapeToReleaseInfo& tape) throw (castor::exception::Exception)=0; - /** Ends a tape session - * @param mountTransactionId the mountTansactionId of the session to end - * @param errorCode an error code is the session is ended due to an error - * if not given, defaults to 0 - * @exception throws castor exceptions in case of failure - */ + /** Ends a tape session by dropping it from the DB. If the tapebridge + * comes afterwards asking for more data on the dropped session, it will + * get an error that shall be gracefully handled on its side. + * @param mountTransactionId the mountTansactionId of the session to end + * @param errorCode an error code is the session is ended due to an error + * if not given, defaults to 0 + * @exception throws castor exceptions in case of failure + */ virtual void endTapeSession(const u_signed64 mountTransactionId, const int errorCode = 0) throw (castor::exception::Exception) = 0; @@ -220,17 +222,6 @@ namespace castor { const std::string &errorMsg) throw (castor::exception::Exception) = 0; - /** - * Set tape session to closing: moves the tape session to a state - * where no more work will be retrieved, in order to get the session - * to fold down gracefully. This mechanism moves the error handling - * back to the tape gateway from the tape server. - * Thanks to this, most of the replies to the tape server can be a neutral - * "got it". - */ - virtual void setTapeSessionToClosing (u_signed64 mountTransactionId) - throw (castor::exception::Exception) = 0; - /** * Get the next best files to migrate */ diff --git a/castor/tape/tapegateway/daemon/ora/OraTapeGatewaySvc.cpp b/castor/tape/tapegateway/daemon/ora/OraTapeGatewaySvc.cpp index 3f972bf670bacd3e3dc1d4954b66eb7ceec63345..33b10e9672ed631924aa40509d08728d93c4c6d4 100644 --- a/castor/tape/tapegateway/daemon/ora/OraTapeGatewaySvc.cpp +++ b/castor/tape/tapegateway/daemon/ora/OraTapeGatewaySvc.cpp @@ -90,7 +90,6 @@ castor::tape::tapegateway::ora::OraTapeGatewaySvc::OraTapeGatewaySvc(const std:: m_deleteMigrationMountWithBadTapePoolStatement(0), m_flagTapeFullForMigrationSession(0), m_getMigrationMountVid(0), - m_setTapeSessionToClosing(0), m_getBulkFilesToMigrate(0), m_getBulkFilesToRecall(0), m_setBulkFileMigrationResult(0), @@ -143,7 +142,6 @@ void castor::tape::tapegateway::ora::OraTapeGatewaySvc::reset() throw() { if ( m_deleteMigrationMountWithBadTapePoolStatement ) deleteStatement(m_deleteMigrationMountWithBadTapePoolStatement); if ( m_flagTapeFullForMigrationSession ) deleteStatement(m_flagTapeFullForMigrationSession); if ( m_getMigrationMountVid ) deleteStatement(m_getMigrationMountVid); - if ( m_setTapeSessionToClosing ) deleteStatement(m_setTapeSessionToClosing); if ( m_getBulkFilesToMigrate ) deleteStatement(m_getBulkFilesToMigrate); if ( m_getBulkFilesToRecall ) deleteStatement(m_getBulkFilesToRecall); if ( m_setBulkFileMigrationResult ) deleteStatement(m_setBulkFileMigrationResult); @@ -166,7 +164,6 @@ void castor::tape::tapegateway::ora::OraTapeGatewaySvc::reset() throw() { m_deleteMigrationMountWithBadTapePoolStatement=0; m_flagTapeFullForMigrationSession=0; m_getMigrationMountVid=0; - m_setTapeSessionToClosing=0; m_getBulkFilesToMigrate=0; m_getBulkFilesToRecall=0; m_setBulkFileMigrationResult=0; @@ -866,7 +863,7 @@ void castor::tape::tapegateway::ora::OraTapeGatewaySvc::cancelMigrationOrRecall handleException(e); castor::exception::Internal ex; ex.getMessage() - << "Error caught in deleteMigrationMountWithBadTapePool" + << "Error caught in cancelMigrationOrRecall" << std::endl << e.what(); throw ex; } @@ -954,30 +951,6 @@ void castor::tape::tapegateway::ora::OraTapeGatewaySvc::getMigrationMountVid(con } } - -//---------------------------------------------------------------------------- -// setTapeSessionClosing -//---------------------------------------------------------------------------- - -void castor::tape::tapegateway::ora::OraTapeGatewaySvc::setTapeSessionToClosing(u_signed64 mountTransactionId) -throw (castor::exception::Exception){ - try { - if (!m_setTapeSessionToClosing) { - m_setTapeSessionToClosing = - createStatement("BEGIN tg_setTapeSessionToClosing(:1); END;"); - } - m_setTapeSessionToClosing->setNumber(1,occiNumber(mountTransactionId)); - m_setTapeSessionToClosing->executeUpdate(); - } catch (oracle::occi::SQLException e) { - handleException(e); - castor::exception::Internal ex; - ex.getMessage() - << "Error caught in setTapeSessionToClosing" - << std::endl << e.what(); - throw ex; - } -} - //---------------------------------------------------------------------------- // getBulkFilesToMigrate //---------------------------------------------------------------------------- diff --git a/castor/tape/tapegateway/daemon/ora/OraTapeGatewaySvc.hpp b/castor/tape/tapegateway/daemon/ora/OraTapeGatewaySvc.hpp index 3a87d03b402c21aa9897c301190f0c3927efbc43..f5139574fa6eb8d5d20a710ca7024acf7cf26667 100644 --- a/castor/tape/tapegateway/daemon/ora/OraTapeGatewaySvc.hpp +++ b/castor/tape/tapegateway/daemon/ora/OraTapeGatewaySvc.hpp @@ -129,7 +129,9 @@ namespace castor { castor::tape::tapegateway::Volume& volume) throw (castor::exception::Exception); - /** Ends a tape session + /** Ends a tape session by dropping it from the DB. If the tapebridge + * comes afterwards asking for more data on the dropped session, it will + * get an error that shall be gracefully handled on its side. * @param mountTransactionId the mountTansactionId of the session to end * @param errorCode an error code is the session is ended due to an error * if not given, defaults to 0 @@ -175,17 +177,6 @@ namespace castor { virtual void flagTapeFullForMigrationSession(const u_signed64& tapeRequestId) throw (castor::exception::Exception); - /** - * Set tape session to closing: moves the tape session to a state - * where no more work will be retrieved, in order to get the session - * to fold down gracefully. This mechanism moves the error handling - * back to the tape gateway from the tape server. - * Thanks to this, most of the replies to the tape server can be a neutral - * "got it". - */ - virtual void setTapeSessionToClosing (u_signed64 mountTransactionId) - throw (castor::exception::Exception); - /** * Get the next best files to migrate */ @@ -248,7 +239,6 @@ namespace castor { oracle::occi::Statement *m_deleteMigrationMountWithBadTapePoolStatement; oracle::occi::Statement *m_flagTapeFullForMigrationSession; oracle::occi::Statement *m_getMigrationMountVid; - oracle::occi::Statement *m_setTapeSessionToClosing; oracle::occi::Statement *m_getBulkFilesToMigrate; oracle::occi::Statement *m_getBulkFilesToRecall; oracle::occi::Statement *m_setBulkFileMigrationResult;