Agente locking rows in db2 on AS400

Hello,

I recently migrated my server from Domino 5.010 to 6.02, everything went well with the exception of the agents that send data from domino to DB2 on AS400.

I can writte the data with no problems and i get no errors but everytime that I writte to DB2 the connection is locking the last line (row) that I writte.

So when the DB2 system tryes to use the table that I wrotte to it can’t because it have’s locked rows.

Is there anyone else with the same problem?

Thank you!!

Subject: RE: agente locking rows in db2 on AS400

There’s an Enterprise Integration Forum on this website for relational database questions.

Please provide more detail. There are several different ways to access DB2 information from an agent.

If you’re using the LC LSX, this is not a bug I’ve heard about and I am in a position where I think I would have. Therefore I’m thinking that it’s not a bug, but something specific in your code. There must be something special that your script is doing, or that another script is doing that affects your script. The likeliest problem has to do with connection pooling. If your script (or another script running in the same environment) is activating connection pooling, then when your script ends, and the LotusScript environment is deallocated, your LCConnection object is not being disconnected – instead it returns to the pool. If there were uncompleted transactions they are not completed.

Please make sure your script explicitly commits (or rolls back) any pending transactions before it exits.

Subject: RE: agente locking rows in db2 on AS400

Hi, thank you for your response.

In fact I’m using connection pooling and I explicity call the commit method before I disconnect from the DB2

here goes the agente code:

Dim DBsession As New LCSession()

Dim DB2Connect As New LCConnection("db2")

Dim fldlst As  LCFieldList

Dim fld  As LCField	



'vai buscar a base de dados de reclamações

Set db = session.CurrentDatabase

Set DbRec = session.getdatabase(db.server,Left$(db.filepath,Len(db.filepath)-Len(db.filename))+"LIDLMRec.nsf")	

'vista para as recs aprovadas

Set ViewAprovadas = DbRec.getview("(recsAprovadas)")

Set doc = ViewAprovadas.getfirstdocument()

'base de dados de historico

Set dbHistorico = session.getdatabase(db.server,Left$(db.filepath,Len(db.filepath)-Len(db.filename))+"WawiHistory.nsf")	

'connect ao DB2 (Parametros de login)

DB2Connect.Database = "S65A2A5A"

DB2Connect.Userid = "it_lei2"

DB2Connect.Password = "alfabeto"	

DB2Connect.NoJournal = True

’ DBsession.ConnectionPooling=True

DB2Connect.Metadata = "DSNLIDL.PTIREC"

DB2Connect.Connect 'Connect to DB2	

Set fld = fldLst.Append("RECFEC", LCTYPE_INT)

fld.Value = Val(Format$(doc.PEPFE2(0),"yyyymmdd"))

docLinhaRec.RECFE2=Val(Format$(doc.PEPFE2(0),"yyyymmdd"))			

Set fld = fldLst.Append("RECFE2", LCTYPE_INT)

fld.Value = Val(Format$(doc.PEPFE2(0),"yyyymmdd"))

DB2Connect.MapByName = True		

Call  DB2Connect.Insert(fldLst)								

Delete fldLst	

Call DB2Connect.Action(LCACTION_COMMIT)	

Call DB2Connect.Action(LCACTION_RESET)

Call DB2Connect.Action(LCACTION_CLEAR)

DB2Connect.Disconnect