SAK }‘ŠÙ

SAK Streets ƒƒCƒ“ƒXƒgƒŠ[ƒg }‘ŠÙEƒJƒtƒF ˆê—— SAK Streets ŒŸõ
| VB | SQL | Perl | PHP | ASP | JSP | C | PC | HP | FAQ | ƒtƒŠ[ƒ\ƒtƒg |

ASP VB Script oo4o + SQL ‰ž—p•Ò2 oo4o Ú‘± - CreateDatabasePool

oo4o ‚́AOracle RDBMS ‚Å‚ÝŽg—p‰Â”\‚Å‚·B

¡global.asa ‚Å‚Ì oo4o Ú‘±

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
option explicit

Sub Application_OnStart

'** oo4o ƒIƒuƒWƒHƒNƒgì¬
  Set Application("OraSession") = Server.CreateObject("OracleInProcServer.XOraSession") 

End Sub

Sub Application_OnEnd

'** oo4o ƒIƒuƒWƒHƒNƒg”pŠü
  Set Application("OraSession") = Nothing

End Sub

Sub Session_OnStart

'** ƒZƒbƒVƒ‡ƒ“ƒ^ƒCƒ€ƒAƒEƒg
  Session.Timeout = 20

'** ƒXƒNƒŠƒvƒgƒ^ƒCƒ€ƒAƒEƒg
  Server.ScriptTimeout = 120

'** oo4o ƒZƒbƒVƒ‡ƒ“ì¬
  Set Session("OraDatabase") = Application("OraSession").DbOpenDatabase("", "SAK/SAK", 0)

End Sub 

Sub Session_OnEnd

'** oo4o ƒZƒbƒVƒ‡ƒ“”pŠü
  Set Session("OraDatabase") = Nothing

End Sub

</SCRIPT>

¡•â‘«

  Esession("OraSession") ‚ɂ‚¢‚ẮAapplication("OraSession") ‚Ì•û‚Å
    ’è‹`‚µ‚Ä‚Ý‚½B

  E‚±‚Ì global.asa ‚Ì’è‹`‚ðŽg—p‚·‚é‚ƁAasp ‚ł́A
      application("OraSession")
      Session("OraDatabase")
    ‚ªŽg—p‚Å‚«‚éB

¡Ú‘±ƒv[ƒ‹‚ÌŽg—p

  EÚ‘±ƒv[ƒ‹Žg—p‚́A‹Œƒo[ƒWƒ‡ƒ“‚Ì oo4o ‚Å‚ÍŽ©‘O‚Å DLL ‚ðì¬‚·‚éB
    Å‹ß‚Ì oo4o ‚ł́ACreateDatabasePool ‚È‚Ç‚ª•W€‚ÅŽg—p‚Å‚«‚éB

<OBJECT RUNAT=Server SCOPE=Application ID=OraSession
  PROGID="OracleInProcServer.XOraSession">
</OBJECT>
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
option explicit

Sub Application_OnStart

  const dbname = ""
  const cnuser = "SAK/SAK"

'** oo4o Ú‘±ƒv[ƒ‹ì¬
  OraSession.CreateDatabasePool 20, 100, 200, dbname, cnuser, 0
                               '|   |    |_ timeout seconds
                               '|   |_ max size
                               '|_ init size

End Sub

Sub Application_OnEnd

'** oo4o Ú‘±ƒv[ƒ‹”pŠü
  OraSession.DestroyDatabasePool

End Sub

Sub Session_OnStart

'** ƒZƒbƒVƒ‡ƒ“ƒ^ƒCƒ€ƒAƒEƒg
  Session.Timeout = 20

'** ƒXƒNƒŠƒvƒgƒ^ƒCƒ€ƒAƒEƒg
  Server.ScriptTimeout = 120

'** oo4o ƒZƒbƒVƒ‡ƒ“ì¬
  Set Session("OraDatabase") = OraSession.GetDatabaseFromPool(100)
                                                             '|_ wait time seconds

End Sub 

Sub Session_OnEnd

'** oo4o ƒZƒbƒVƒ‡ƒ“”pŠü
  Set Session("OraDatabase") = Nothing

End Sub

</SCRIPT>

¡XV—p“Á•ÊƒZƒbƒVƒ‡ƒ“‚ÌŽg—p

  EÚ‘±ƒv[ƒ‹‚ðŽg—p‚µ‚Ă̍XV‚́A‚¢‚ë‚¢‚ë‚Æ–â‘肪‚ ‚é‚悤‚Å‚ ‚éB
    XV—p“Á•ÊƒZƒbƒVƒ‡ƒ“‚ŏˆ—‚·‚é‚Ì‚ª‘Ó–‚炵‚¢B

  const dbname = ""
  const cnuser = "SAK/SAK"

  Application.Lock
  Set oss = OraSession.Client.CreateSession("#" & Session.SessionID)
  Set odb = oss.OpenDatabase(dbname, cnuser, 0)
  Application.Unlock

  odb.BeginTrans

  odb.ExecuteSQL ...
  ... odb.Rollback

  odb.CommitTrans

  Application.Lock
  Set odb = Nothing
  Set oss = Nothing
  Application.Unlock

¡ASP VB Script oo4o + SQL ‰ž—p•ÒŽ‘—¿
¡ASP VB Script ADO + SQL ‰ž—p•ÒŽ‘—¿
¡ASP VB Script Šî‘bŽÀ’n•ÒŽ‘—¿
¡ASP VB Script Šî‘b•ÒŽ‘—¿
¡SQL Šî‘b•ÒŽ‘—¿
¡SQL Šî‘bŽÀ’n•ÒŽ‘—¿
¡SQL ƒ`ƒ…[ƒjƒ“ƒO•ÒŽ‘—¿
¡Oracle PL/SQL •ÒŽ‘—¿
¡PostgreSQL •ÒAJAVA ServletAJSP •ÒŽ‘—¿
¡MySQL •ÒŽ‘—¿
| VB | SQL | Perl | PHP | ASP | JSP | C | PC | HP | FAQ | ƒtƒŠ[ƒ\ƒtƒg |

SAK Streets ƒƒCƒ“ƒXƒgƒŠ[ƒg }‘ŠÙEƒJƒtƒF ˆê—— SAK Streets ŒŸõ



Copyright (C) 1999-2017 Y.SAK