Skip to main content
This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks

  

PreviousPrevious NextNext


Michael Zens 12.Dec.07 03:59 PM a Web browser
Domino Designer 7.0.2; 6.0.3 Windows XP


I am trying to redirect users to replica on server A when they access a database server B or Server C, providing that Server A is accessible, and close the other database they originally opened. This code works for Notes Client 6.0.3 but when ran on Client 7.0.2 the Notes Client status bar states - "Error - script is busy" and the Client shuts down. When I rem out the Call uidb.close line then the 7.0.2 client does not shut down and both db's are open on the client. Is this a bug in Notes 7.0.2 or is there a work around.

Here is my code in the Database script:

Sub Postopen(Source As Notesuidatabase)
'01/05/2007 (mdz) this script checks the current server and if it is "ServerB" then it will attempt to open the
'production database on "ServerA". If open is successful then it redirects the user to the production replica
'and closes the source database and also removes the icon on the desktop for the offending database when the database closes.
removeIcon = False 'this will flag to remove the Icon being used if set to true
Dim ws As New NotesUIWorkspace
Dim ses As New NotesSession
Dim uidb As NotesUIDatabase
Dim thisdb As NotesDatabase
Dim prodDBA As New NotesDatabase ("","")
Dim prodDBB As New NotesDatabase ("","")
Dim configDoc As NotesDocument
Dim nam As NotesName
Dim repID As String, msgTitle As String, message As String

'setup Notes Stuff
Set uidb = source
Set thisdb = uidb.Database
Set nam = ses.CreateName(thisDB.Server)
Set configDoc = thisDb.GetProfileDocument("Systemdoc")
'get replica of Db and try to open the Production Database
repID = thisDb.ReplicaID 'used to find replica on production server
thisServer = nam.Abbreviated
thisDbPath = thisDB.filePath
'get the names of the servers from the system document
prodServerA = configDoc.GetItemValue("prodServerA") 'first production copy
prodServerAName = prodServerA(0)
prodServerB = configDoc.GetItemValue("prodServerB") 'second Production Server
prodServerBName = prodServerB(0)
DRServer = configDoc.GetItemValue("drServer") 'disaster recovery server
drServerName = DRServer(0)

If thisServer = prodServerAName Then Exit Sub 'it is the production server so allow access

If thisServer = prodServerBName Then 'it is on the 1st backup server
'check availablity of production database on production server
If ProdDbA.OpenbyReplicaID(prodServerAName,repID) Then 'production is up and running
removeIcon = True
Call ws.OpenDatabase(ProdDbA.Server,ProdDbA.filePath,"(All Wires)") 'open the production database
' Call uidb.Close 'close the original database used
Set thisDB = Nothing
Set ProdDb = Nothing
Exit Sub 'done with script
Else
Exit Sub 'allow access to the current database
End If
End If

If thisServer = drServerName Then 'then it is on the disaster recovery server
'try to open production db based on source db replica id, then try 1st backup server after that.
'If both are down then allow access to DR Db.
If ProdDbA.OpenbyReplicaID(prodServerAName,repID) Then 'production is up and running
removeIcon = True
Call ws.OpenDatabase(ProdDbA.Server,ProdDbA.filePath,"(All Wires)") 'open the production database
' Call uidb.Close 'close the original database used
Set thisDB = Nothing
Set ProdDbA = Nothing
Set ProdDbB = Nothing
Exit Sub 'done with script
Elseif ProdDbB.OpenbyReplicaID(prodServerB(0),repID) Then 'production server down - check for 1st back up server
removeIcon = True
Call ws.OpenDatabase(ProdDbBB.Server,ProdDbB.filePath,"(All Wires)") 'open the 1st backup database
' Call uidb.Close 'close the original database used
Set thisDB = Nothing
Set ProdDbA = Nothing
Set ProdDbB = Nothing
Exit Sub 'done with script
Else
'looks like both Server A and Server B are down - open the DR server replica AKA Server C
End If
End If
Goto EndofCode
EndOfCode:

End Sub






uidb.close in dbScript Not working ... (Michael Zens 12.Dec.07)
. . RE: uidb.close in dbScript Not work... (Dan Zeller 12.Dec.07)





  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite