Application/Database Getting Hang
we are facing issues in our application , database.earlier our application having front end classic asp, asp.net , backend sql server 2000. migrated sql server 2000 to sql server 2005 thereafter problem started appliccation & database getting hang . facing issues of application & database getting hang during project assignment team. if more 20 users login application time if edit assignment application , database hangs.
code used in asp page for assignment team.
<%
response.buffer = true
%>
<!--#include virtual="/includes/admin_security.asp"-->
<!--#include virtual = "/includes/db_con.asp"-->
<!--#include virtual = "/includes/dbcon1.asp"-->
<!--#include virtual="/error.asp"-->
<%
field_names = split(replace(request.form("field_name"),"'","''"),", ")
field_id = split(replace(request.form("field_id"),"'","''"),", ")
field_validators = split(replace(request.form("field_validator"),"'","''"),", ")
name_check = split(replace(request.form("name_check"),"'","''"),"*")
fld_group = split(replace(request.form("fld_group"), "'", "''"),", ")
letter_case = split(replace(request.form("letter_case"),"'","''"),", ")
txt_exclude = split(replace(request.form("txt_exclude"),"'","''"),", ")
txt_include = split(replace(request.form("txt_include"),"'","''"),", ")
is_multiples = split(replace(request.form("is_multiple"),"'","''"),", ")
assign_group = split(request.form("assignment"),", ")
project_id = request.form("project_id")
mult_length= split(replace(request.form("mult_length"), "'", "''"),"*")
txt_conf=split(replace(request.form("txt_conf"),"'","''"),", ")
if trim(request.form("qc")) <> "" then
qcs = split(request.form("qc"),", ")
else
response.write "<script language=javascript>alert('select member quality team');history.back(-1);</script>"
response.end
end if
if trim(request.form("rw")) <> "" then
rws = split(request.form("rw"),", ")
else
response.write "<script language=javascript>alert('select member rework team');history.back(-1);</script>"
response.end
end if
dim con,con1, rs,rs1
set con = server.createobject("adodb.connection")
set con1 = server.createobject("adodb.connection")
con.open dbcon
con1.open dbcon1
con.begintrans
for z =0 ubound(assign_group)
if trim(request.form("coders_"&assign_group(z))) <> "" then
checkcoders = checkcoders & request.form("coders_"&assign_group(z)) &", "
else
response.write "<script language=javascript>alert('select coder " & assign_group(z) & " field');history.back(-1);</script>"
response.end
end if
next
checkcodersarray = split(checkcoders,", ")
for p = 0 ubound(checkcodersarray)
for q = 0 ubound(qcs)
if (checkcodersarray(p) = qcs(q)) then
response.write "<script language=javascript>alert('coder can not member of quality team');history.back(-1);</script>"
response.end
end if
next
for r = 0 ubound(rws)
if (checkcodersarray(p) = rws(r)) then
response.write "<script language=javascript>alert('coder can not member of rework team');history.back(-1);</script>"
response.end
end if
next
next
for s = 0 ubound(qcs)
for t = 0 ubound(rws)
if (qcs(s) = rws(t)) then
response.write "<script language=javascript>alert('quality team member can not rework team member');history.back(-1);</script>"
response.end
end if
next
next
con.execute("update t_document set is_locked = 0,status = 0 project_id = "&project_id&" , is_locked = 1 , status <> 0 , status in (select user_id t_user_access project_id = "&project_id&" , access_id = 2)")
con.execute ("delete t_user_access project_id = "&project_id&" , access_id = 2")
con.execute ("update t_field set field_status = 0 project_id = "&project_id)
for =0 ubound(field_names)
if <= ubound(field_id) then
con.execute("update t_field set field_name = '"&field_names(i)&"',field_validator = "&field_validators(i)&",choice_list = '"&trim(name_check(i))&"',is_multiple = "&is_multiples(i)&", multiple_length = "& mult_length(i)&" ,letter_case = '"&letter_case(i)&"',includes = '"&txt_include(i)&"',excludes = '"&txt_exclude(i)&"', conversion_factor='" & txt_conf(i) & "',field_status = 1, field_group = " & fld_group(i) & ",assign_group = '"&assign_group(i)&"' field_id = "&field_id(i)&" , project_id = "&project_id)
else
'con.execute("insert t_field(project_id,field_name,field_validator,choice_list,is_multiple,multiple_length,letter_case,includes,excludes,field_status,field_group,assign_group) values("&project_id&",'"&field_names(i)&"',"&field_validators(i)&",'"&trim(name_check(i))&"',"&is_multiples(i)&", '"& mult_length(i) &"','"&letter_case(i)&"','"&txt_include(i)&"','"&txt_exclude(i)&"',1,"&fld_group(i)&",'"&assign_group(i)&"')")
con.execute("insert t_field(project_id,field_name,field_validator,choice_list,is_multiple,multiple_length,letter_case,includes,excludes,conversion_factor,field_status,field_group,assign_group) values("&project_id&",'"&field_names(i)&"',"&field_validators(i)&",'"&trim(name_check(i))&"',"&is_multiples(i)&", '"& mult_length(i) &"','"&letter_case(i)&"','"&txt_include(i)&"','"&txt_exclude(i)&"','" & txt_conf(i)&"',1,"&fld_group(i)&",'"&assign_group(i)&"')")
end if
next
con.execute("delete t_hr_rep field_id in (select field_id t_field project_id=" & project_id & " , field_status=0)")
con.execute("delete t_data field_id in (select field_id t_field project_id=" & project_id & " , field_status=0)")
con.execute("delete t_field project_id=" & project_id & " , field_status=0")
if ubound(field_names) > ubound(field_id) then
con.execute ("update t_document set is_checked = 0 project_id = " & project_id)
end if
con.execute ("delete t_rep_format field_id in (select field_id t_field field_status = 0)")
con.execute ("delete t_user_access project_id = "&project_id&" , access_id = 3")
for k = 0 ubound(qcs)
con.execute("insert t_user_access(user_id,access_id,project_id,field_id) values("&qcs(k)&",3,"&project_id&",0)")
next
con.execute("update t_document set is_locked = 0,status = 0 project_id = "&project_id&" , is_locked = 1 , status <> 0 , status in (select user_id t_user_access project_id = "&project_id&" , access_id = 4)")
con.execute ("delete t_user_access project_id = "&project_id&" , access_id = 4")
for z = 0 ubound(rws)
con.execute("insert t_user_access(user_id,access_id,project_id,field_id) values("&rws(z)&",4,"&project_id&",0)")
next
con.execute("update t_document set is_locked = 0,status = 0, reworker_id = null project_id = "&project_id&" , qc_id not in (select user_id t_user_access project_id = "&project_id&" , access_id = 3)")
con.committrans
set userlist = server.createobject("adodb.recordset")
userlist.open "select * t_field project_id = "&project_id &" order field_id",con
while not userlist.eof
group = userlist("assign_group")
fldid = userlist("field_id")
users = split(request.form("coders_"&group),", ")
for lvl = 0 ubound(users)
con.execute("insert t_user_access(user_id,access_id,project_id,field_id) values("&users(lvl)&",2,"&project_id&","&fldid&")")
next
userlist.movenext
wend
set userlist = nothing
con.close
set con = nothing
response.redirect "admin_home.asp?param=projecteditsuccess"
response.end()
%>
thank in advance
hi,
can check/post sql error log information related windows event logs please?
thanks,
janos
there 10 type of people. understand binary , not.
my blog
SQL Server > SQL Server Express
Comments
Post a Comment