ASP - Problemas al conectar

 
Vista:

Problemas al conectar

Publicado por Felix Mejia (2 intervenciones) el 04/04/2008 02:27:11
Muchachos,

tengo un percance al momento de trabajar en un sistema hecho en ASP, courre el problema cuando la trabajan mas de 20 minutos seguidos o dos personas trabajan a la vez.

No encuentra la pagina, sale en el error, luego que hay error en la pagina de logueo.asp y despues de 5 minutos se restablece todo.

El codigo en la que hace el logueo es el siguiente:

<!--#include virtual="/Support/Solicitud/Conexion_St.asp"-->
<%

%>
<html>
<head>
<title>Verificamos si esta logeado en Intranet </title>
</head>
<script language="javascript">
function fnc_abre(xpage)
{
//window.location.replace(xpage)
window.location.replace(xpage);
//var win = top.window.self;
//win.opener=top.window.self;
//win.parent.close();
}
</script>
<body>
<%

vc_CodUsu = REQUEST.Form("cod")
xsist = "STDBA"
'response.Write vc_CodUsu
'response.end
'******** Captura Nombre del sistema
vc_sql = " SELECT /*+ RULE */ DES_SIS FROM SGDBA.SG8SIS WHERE NOM_SIS = 'STDBA'"
ors.open vc_sql, Conn
vc_DesSis = ors("DES_SIS")
ors.close

SQL = "SELECT COD_LOG FROM SGDBA.SG1USU WHERE COD_USU = '" & vc_CodUsu & "'"

'Response.write(SQL)

ors_aux.OPEN SQL,Conn
usrlogin = ors_aux("COD_LOG")
ors_aux.CLOSE

'******** Captura valores del usuario para la cookies
vc_sql= " SELECT CODUSU, INITCAP(APEPAT) ||' '|| INITCAP(APEMAT) || ', ' || INITCAP(NOMBRES) NOMUSU, "&_
" CODSUB "&_
" FROM DPDBA.USUARIO U INNER JOIN SGDBA.SG2USUSISROL R ON U.CODUSU = R.COD_USU WHERE CODUSU = "&_
" '" & vc_CodUsu &"' AND COD_ROL LIKE '%"& xsist &"%'"
'response.write vc_sql
ors.open vc_sql,Conn
vc_Cont = ors.recordcount

if vc_cont > 0 then
vc_NomUsu = ors("NOMUSU")
vc_CodUbi = ors("CODSUB")
ors.close

SQL = "SELECT COD_LOG FROM SGDBA.SG1USU WHERE COD_USU = '" & vc_CodUsu & "'"
ors.open SQL,Conn
usrlogin = ors("COD_LOG")
ors.close


RESPONSE.COOKIES("ST")("Ip") = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
RESPONSE.COOKIES("ST")("CodUsu") = vc_CodUsu
RESPONSE.COOKIES("ST")("CodLog") = usrlogin
RESPONSE.COOKIES("ST")("NomUsu") = vc_NomUsu
RESPONSE.COOKIES("ST")("CodUbi") = vc_CodUbi
RESPONSE.COOKIES("ST")("DesSis") = vc_DesSis
RESPONSE.COOKIES("ST").Expires = Date + 1

response.Write("<script language='javascript'>fnc_abre('St_principal.asp')</script>")
else
response.Redirect("index.asp")
end if
%>
</body>
</html>
<%
Set ors = Nothing
Set ors_aux = Nothing
Conn.Close
Set Conn= Nothing
%>

Mi pagina que hace la conexion tien el siguiente codigo:

<%
Usr = "STUSER"
Pws = "STUSER"
Set Conn = Server.CreateObject("ADODB.Connection")
'Conn.open ("Provider=OraOLEDB.Oracle.1;Password="+ Pws +";Persist Security Info=True;User ID="+ Usr +";Data Source=DESA")
'Conn.open ("Provider=OraOLEDB.Oracle.1;Password="+ Pws +";Persist Security Info=True;User ID="+ Usr +";Data Source=PRODU" )
Conn.ConnectionString = "Provider=OraOLEDB.Oracle;Data Source=PRODU;User ID=STUSER; Password=STUSER;"
Conn.open
'Conn.open ("Provider=OraOLEDB.Oracle.1;Password="+ Pws +";Persist Security Info=True;User ID="+ Usr +";Data Source=DESA" )

Set ors = Server.CreateObject("ADODB.Recordset")
ors.ActiveConnection = Conn
ors.CursorType = 3 'CONST adOpenStatic = 3'
ors.LockType = 1 'CONST adReadOnly = 1'

Set ors_aux = Server.CreateObject("ADODB.Recordset")
ors_aux.ActiveConnection = Conn
ors_aux.CursorType = 3 'CONST adOpenStatic = 3
ors_aux.LockType = 1 'CONST adReadOnly = 1

Set ors_aux1 = Server.CreateObject("ADODB.Recordset")
ors_aux1.ActiveConnection = Conn
ors_aux1.CursorType = 3 'CONST adOpenStatic = 3
ors_aux1.LockType = 1 'CONST adReadOnly = 1

Set ors_aux2 = Server.CreateObject("ADODB.Recordset")
ors_aux2.ActiveConnection = Conn
ors_aux2.CursorType = 3 'CONST adOpenStatic = 3
ors_aux2.LockType = 1 'CONST adReadOnly = 1

Set ors_aux3 = Server.CreateObject("ADODB.Recordset")
ors_aux3.ActiveConnection = Conn
ors_aux3.CursorType = 3 'CONST adOpenStatic = 3
ors_aux3.LockType = 1 'CONST adReadOnly = 1

Set ors_aux4 = Server.CreateObject("ADODB.Recordset")
ors_aux4.ActiveConnection = Conn
ors_aux4.CursorType = 3 'CONST adOpenStatic = 3
ors_aux4.LockType = 1 'CONST adReadOnly = 1

%>
<%
Set oError = Server.GetLastError()
if oError.ASPCode<>"" then
response.End()
conn.close
end if
%>
<%
if response.IsClientConnected = "false" then
response.End()
conn.close
end if
%>


Mi pregunta es......QUE DEBO HACER EN ESTOS CODIGOS PARA EVITAR ESTOS PROBLEMAS DE CAIDAS DEL SISTEMA?. ME FALTA ALGUNA VALIDACION?

Gracias de antemano.

Felix
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder