public virtual void CloseContext(PersistenceContext context)
 {
     LogMethodCall("closeContext", context);
     Db4oPersistenceProvider.MyContext customContext = My(context);
     if (null != customContext)
     {
         CloseIgnoringExceptions(customContext.metadata);
         CloseIgnoringExceptions(customContext.data);
         context.SetProviderContext(null);
     }
 }
Example #2
0
 // TODO Auto-generated method stub
 public virtual void InitContext(PersistenceContext context)
 {
     LogMethodCall("initContext", context);
     var metadata = OpenMetadata(context.Url());
     try
     {
         var repository = InitializeClassRepository(metadata);
         var reflector = new CustomReflector(repository);
         var data = OpenData(reflector, context.Url());
         context.SetProviderContext(new MyContext(repository, metadata
             , data));
     }
     catch (Exception e)
     {
         Runtime.PrintStackTrace(e);
         // make sure metadata container is not left open
         // in case something goes wrong with the setup
         CloseIgnoringExceptions(metadata);
         // cant use exception chaining here because the
         // test must run in jdk 1.1
         throw new Db4oException(e);
     }
 }
Example #3
0
        // TODO Auto-generated method stub
        public virtual void InitContext(PersistenceContext context)
        {
            LogMethodCall("initContext", context);
            var metadata = OpenMetadata(context.Url());

            try
            {
                var repository = InitializeClassRepository(metadata);
                var reflector  = new CustomReflector(repository);
                var data       = OpenData(reflector, context.Url());
                context.SetProviderContext(new MyContext(repository, metadata
                                                         , data));
            }
            catch (Exception e)
            {
                Runtime.PrintStackTrace(e);
                // make sure metadata container is not left open
                // in case something goes wrong with the setup
                CloseIgnoringExceptions(metadata);
                // cant use exception chaining here because the
                // test must run in jdk 1.1
                throw new Db4oException(e);
            }
        }
Example #4
0
 public virtual void CloseContext(PersistenceContext context)
 {
     LogMethodCall("closeContext", context);
     var customContext = My(context);
     if (null != customContext)
     {
         CloseIgnoringExceptions(customContext.metadata);
         CloseIgnoringExceptions(customContext.data);
         context.SetProviderContext(null);
     }
 }