Package net.sf.hajdbc

Examples of net.sf.hajdbc.DumpRestoreSupport


  @Override
  public <Z, D extends Database<Z>> void synchronize(SynchronizationContext<Z, D> context) throws SQLException
  {
    Dialect dialect = context.getDialect();
    Decoder decoder = context.getDecoder();
    DumpRestoreSupport support = dialect.getDumpRestoreSupport();
   
    if (support == null)
    {
      throw new SQLException(Messages.DUMP_RESTORE_UNSUPPORTED.getMessage(dialect));
    }
   
    try
    {
      File file = Files.createTempFile(DUMP_FILE_SUFFIX);
     
      try
      {
        support.dump(context.getSourceDatabase(), decoder, file);
        support.restore(context.getTargetDatabase(), decoder, file);
      }
      finally
      {
        Files.delete(file);
      }
View Full Code Here


   */
  @Override
  public <Z, D extends Database<Z>> void synchronize(SynchronizationContext<Z, D> context) throws SQLException
  {
    Dialect dialect = context.getDialect();
    DumpRestoreSupport support = dialect.getDumpRestoreSupport();
   
    if (support == null)
    {
      throw new SQLException(Messages.DUMP_RESTORE_UNSUPPORTED.getMessage(dialect));
    }
   
    try
    {
      File file = Files.createTempFile(DUMP_FILE_SUFFIX);
     
      try
      {
        startProcess(support.createDumpProcess(new ConnectionPropertiesImpl<Z, D>(context, context.getSourceDatabase()), file));
       
        startProcess(support.createRestoreProcess(new ConnectionPropertiesImpl<Z, D>(context, context.getTargetDatabase()), file));
      }
      finally
      {
        Files.delete(file);
      }
View Full Code Here

  @Override
  public <Z, D extends Database<Z>> void synchronize(SynchronizationContext<Z, D> context) throws SQLException
  {
    Dialect dialect = context.getDialect();
    Decoder decoder = context.getDecoder();
    DumpRestoreSupport support = dialect.getDumpRestoreSupport();
   
    if (support == null)
    {
      throw new SQLException(Messages.DUMP_RESTORE_UNSUPPORTED.getMessage(dialect));
    }
   
    try
    {
      File file = Files.createTempFile(DUMP_FILE_SUFFIX);
     
      try
      {
        support.dump(context.getSourceDatabase(), decoder, file, this.dataOnly);
        support.restore(context.getTargetDatabase(), decoder, file, this.dataOnly);
      }
      finally
      {
        Files.delete(file);
      }
View Full Code Here

TOP

Related Classes of net.sf.hajdbc.DumpRestoreSupport

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.