import datetime
import os
import re
import sys
import threading
import time

from config import panda_config
from pandajedi.jediconfig import jedi_config
from pandajedi.jedicore import JediTaskBuffer
from pandalogger.PandaLogger import PandaLogger
from taskbuffer.Initializer import initializer

jediTaskID = sys.argv[1]

# initialize cx_Oracle using dummy connection
initializer.init()


taskBuffer = JediTaskBuffer.JediTaskBuffer(None)
proxy = taskBuffer.proxyPool.getProxy()

s, o = proxy.getClobObj("select task_param from atlas_deft.deft_task where task_id=:task_id", {":task_id": jediTaskID})

taskParamStr = o[0][0]

proxy.insertTaskParams_JEDI(None, taskParamStr)
