- Timestamp:
- 06/26/09 12:18:32 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/3.2/TableAdapterWrapper
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/3.2/TableAdapterWrapper/JobAdapterWrapper.cs
r2083 r2117 7 7 using HeuristicLab.Hive.Contracts.BusinessObjects; 8 8 using System.Data.Common; 9 using System.IO; 10 using System.Data.SqlTypes; 11 using System.Data; 9 12 10 13 namespace HeuristicLab.Hive.Server.ADODataAccess.TableAdapterWrapper { … … 39 42 } 40 43 41 public byte[] GetSerializedJob(Guid jobId) { 42 return TransactionalAdapter.GetSerializedJobById(jobId); 43 } 44 public Stream GetSerializedJobStream(Guid jobId, 45 bool useExistingConnection) { 46 SqlConnection connection = null; 47 SqlTransaction transaction = null; 44 48 45 public bool UpdateSerialiedJob(byte[] serializedJob, Guid jobId) { 46 return TransactionalAdapter.UpdateSerializedJob(serializedJob, jobId) > 0; 49 if (useExistingConnection) { 50 connection = 51 base.Session.Connection as SqlConnection; 52 53 transaction = 54 adapter.Transaction; 55 } else { 56 connection = 57 ((SessionFactory) 58 (base.Session.Factory)).CreateConnection() 59 as SqlConnection; 60 } 61 62 VarBinarySource source = 63 new VarBinarySource( 64 connection, transaction, 65 "Job", "SerializedJob", "JobId", jobId); 66 67 return new VarBinaryStream(source); 47 68 } 48 69 -
trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/3.2/TableAdapterWrapper/JobResultsAdapterWrapper.cs
r2099 r2117 7 7 using HeuristicLab.Hive.Contracts.BusinessObjects; 8 8 using System.Data.Common; 9 using System.IO; 9 10 10 11 namespace HeuristicLab.Hive.Server.ADODataAccess.TableAdapterWrapper { … … 36 37 } 37 38 38 public byte[] GetSerializedJobResult(Guid jobResultId) { 39 return TransactionalAdapter.GetSerializedJobResultById(jobResultId); 40 } 39 public Stream GetSerializedJobResultStream(Guid jobResultId, 40 bool useExistingConnection) { 41 SqlConnection connection = null; 42 SqlTransaction transaction = null; 41 43 42 public bool UpdateSerialiedJobResult(byte[] serializedJobResult, Guid jobResultId) { 43 return TransactionalAdapter.UpdateSerializedJobResultById(serializedJobResult, jobResultId) > 0; 44 if (useExistingConnection) { 45 connection = 46 base.Session.Connection as SqlConnection; 47 48 transaction = 49 adapter.Transaction; 50 } else { 51 connection = 52 ((SessionFactory) 53 (base.Session.Factory)).CreateConnection() 54 as SqlConnection; 55 } 56 57 VarBinarySource source = 58 new VarBinarySource( 59 connection, transaction, 60 "JobResult", "JobResult", "JobResultId", jobResultId); 61 62 return new VarBinaryStream(source); 44 63 } 45 64
Note: See TracChangeset
for help on using the changeset viewer.