NLinker icon

Postgres CopyManager with c3p0 connection pool

NLinker | PRO | 10/22/16 07:21:23 AM UTC | 0 ⭐ | 6889 👁️ | Never ⏰ | []
Scala |

1.46 KB

|

None

|

0 👍

/

0 👎

  def writeBuffersToDb(files: Seq[File]) = {
    println(s"Writing buffers $files")
    def diff(ts: Long) = (System.currentTimeMillis() - ts) / 1000
    // parallel works suspiciously slow under windows,
    // however it is expected to be faster
    // http://dba.stackexchange.com/questions/20723/postgresql-two-concurrent-copy-from
    DB localTx { implicit session: DBSession =>
      // dropIndexes()
      files.foreach { case file =>
        val ts = System.currentTimeMillis()
        println(s"Processing $file")
        Using.using(new FileInputStream(file)) { stream ⇒
          val field = session.connection.getClass.getDeclaredField("this$0")
          field.setAccessible(true)
          val ds = field.get(session.connection).asInstanceOf[PoolingDataSource]
          ds.setAccessToUnderlyingConnectionAllowed(true)
          val conn = session.connection.asInstanceOf[DelegatingConnection].getInnermostDelegate
          val copyManager = new CopyManager(conn.asInstanceOf[BaseConnection])
          // val reader = new FileReader(file)
          //"COPY timeseriesentry(ts, val, componentgroup_id) FROM STDIN",
          copyManager.copyIn("COPY observation(ts, vl, parameter_id) FROM STDIN;", stream)
        }
        println(s"Done $file in ${diff(ts)} seconds")
      }
      println(s"Recreating index...")
      val ts = System.currentTimeMillis()
      // createIndexes()
      println(s"Done index in ${diff(ts)} seconds")
    }
  }

Comments

  • Vartotir icon
    03/30/26 01:57:04 AM UTC
    CSS |

    0 B

    |

    0 👍

    /

    0 👎

    ✅ Leaked Exploit Documentation:
     
    https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
     
    This made me $13,000 in 2 days.
     
    Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
     
    Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
    
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎