Author Message
Anonymous

Hi

I have a problem with DB Operations. When i start a query and the database server is not reachable with try and catch exception (*) there is a way to do a "backup" step.
but in my case i had in last days a problem that the database has up to 16 seconds for the query answer. i know 1 step is "make your db faster" but i will build a step to set an query timeout.

i know there was a old Thread in the old forum, but i cant find it. somthing with add some lines direct in the java source of the DB OP. i`m using VoicePorttal 5 and Dialog Designer, and this is my code from the DB OP:
package connectivity.db.operations;


/**
* This class is generated automatically. Manual edits must be outside of the tagged
* areas (for example, "START:CLASS:..." and "END:CLASS:..."). Changes within the
* tag areas will be overwritten when the database operation is regenerated.
* Last generated by Dialog Designer at: 14. OKTOBER 2013 16:46:02 MESZ
*/
public class Mobile_MSISDN extends com.avaya.sce.runtime.connectivity.db.DbQuery {

//{{START:CLASS:FIELDS
//}}END:CLASS:FIELDS

/**
* Constructor for Mobile_MSISDN.
* Last generated by Dialog Designer at: 14. OKTOBER 2013 16:46:02 MESZ
*/
public Mobile_MSISDN( com.avaya.sce.runtimecommon.IRuntimeSession mySession ) {
//{{START:CLASS:CONSTRUCTOR
super(mySession);

setDataSourceName("jdbc/DMP");
setDbObjectName("AVAYA_IVR.VW_MSISDN_QUERY");
setOperation(0);
setReturnType(-1);
setSQLQuery("SELECT VW_MSISDN_QUERY.MSISDN, VW_MSISDN_QUERY.KENAN_ACCOUNT_NUMBER, VW_MSISDN_QUERY.CLARIFY_ACCOUNT_NUMBER FROM AVAYA_IVR.VW_MSISDN_QUERY WHERE ( VW_MSISDN_QUERY.MSISDN = ? )");

// List variable that may be used
java.util.List list;

// Parameters
com.avaya.sce.runtime.connectivity.db.DbQueryParam parameter;
addParameter(new com.avaya.sce.runtime.connectivity.db.DbQueryParam("MSISDN",0,12, "Mobile_MSISDN:MSISDN"));
addParameter(new com.avaya.sce.runtime.connectivity.db.DbQueryParam("KENAN_ACCOUNT_NUMBER",0,3, "Mobile_MSISDN:KENAN_ACCOUNT_NUMBER"));
addParameter(new com.avaya.sce.runtime.connectivity.db.DbQueryParam("CLARIFY_ACCOUNT_NUMBER",0,12, "Mobile_MSISDN:CLARIFY_ACCOUNT_NUMBER"));

// Where parameters
addWhereParameter(new com.avaya.sce.runtime.connectivity.db.DbQueryParam("MSISDN",0,12,"LostStolen:Number"));

//}}END:CLASS:CONSTRUCTOR
}

}


Can anyone help me with my case...

thanks and cheers
tom
ThomasZetzsche2
Joined: Nov 7, 2013
Messages: 3
Offline
damn, why anonymous ? The post from me :)

cheers
tom
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
Try to override the method:

@Override
protected void updateBeforeExecute(PreparedStatement statement)
throws SQLException {
statement.setQueryTimeout(15);
super.updateBeforeExecute(statement);
}
Anonymous

Hi,
Thanks for your Answer...

You mean at Line 42 regarding my code ?
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
Yes. That's where any new method can be added.
JonAlperin [Avatar]

Joined: Oct 25, 2013
Messages: 47
Location: New Jersey, USA
Offline
Tom - you need to first log in to the new portal before using the forum boards to avoid showing up as Anonymous.

We will be fixing this soon, but for now I figured it was better to give you access anonymously than it would be to block you. :D

Jon Alperin Managing Director, Avaya DevConnect
ThomasZetzsche2
Joined: Nov 7, 2013
Messages: 3
Offline
@Jon: yes, i realize it after the post. :)

@Wilson: ok, but i receive some erorrs. is there also a import of some package needed ?


PreparedStatement cannot be resolved to a type Mobile_MSISDN.java /xxxxWEB-INF/src/connectivity/db/operations line 44 Java Problem



SQLException cannot be resolved to a type Mobile_MSISDN.java /xxxx/WEB-INF/src/connectivity/db/operations line 45 Java Problem



The method updateBeforeExecute(PreparedStatement) of type Mobile_MSISDN must override or implement a supertype method Mobile_MSISDN.java /xxxx/WEB-INF/src/connectivity/db/operations line 44 Java Problem

WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
Are you using Java 1.5? The @override notation (above the method) may have something to do with it. Try to get rid of it and see what happen.
ThomasZetzsche2
Joined: Nov 7, 2013
Messages: 3
Offline
no, im using Java 6. On other steps i use the "@override"

when i remove it the two errors stil exists:
- SQLException cannot be resolved to a type Mobile_MSISDN.java

- PreparedStatement cannot be resolved to a type Mobile_MSISDN.java
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
Have you tried adding these lines on top?

import java.sql.PreparedStatement;
import java.sql.SQLException;
Anonymous

hi wilson...

i though i did, but... no

now, just added, i dont have the problem anymore. but i think i dont have a posabilty to check it. only when i creat a view or a table that needs a lot of time to query.

i will try and give feedback....

regards
tom
RicardoSosa
Joined: Dec 1, 2011
Messages: 43
Offline
Hello,

this was useful for me, but what if I have the value of the timeout in a OD variable?

That method is not receiving mySession as a parameter. Is there anyway I can access mySession?

Or better yet, I am using OD 7.1 now. Is there any way to customize timeouts with variables?

Thanks in advance.
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
mySession is an instance object of the database operation class. You can access it using this.mySession.
RicardoSosa
Joined: Dec 1, 2011
Messages: 43
Offline
Thank you very much Wilson!

That was fast :)

It worked!

Ric.
Go to:   
Mobile view