Audium Knowledge Base

Knowledgebase Home | Contact Knowledgebase Home | Contact
Search the Knowledgebase Jump to ID Browse by Category
Data from one call is appearing in another call
Categories: Audium OpenSDK
Article ID: 117
Last updated: January 08, 2007
User Opinions
No users have voted.

How would you rate this answer?
Helpful
Not helpful
SUMMARY

This article describes why data captured and stored in one call might suddenly appear and be used in subsequent calls, as well as how to rectify this problem.

SYMPTOMS

Caller A calls into the application, and enters some data.  Caller B calls into the same application after Caller A, and the application reuses the data that Caller A has previously entered.  This will either manifest itself in the call itself (e.g. unexpected prompts or behavior), or will show up in the log (i.e. data that Caller B did not enter is logged).

Note that this may also occur with data that was generated by the application itself, not only with caller-entered data.  For example, if a custom class calculates a value and uses it throughout the first call, this calculated value (which is incorrect for the next call) may be reused is subsequent calls.

RESOLUTION

This problem is caused by member variables being used in custom Java classes.  Note that it does not matter whether or not the member variables were declared as static, since all member variables will be treated as static at runtime.  This is a result of the classes being instantiated just once for all calls, and the same instance being reused.  Because of this, member variables should never be used in custom Java code.

The solution is to remove all member variables from the code, and instead use only local-scope variables within the methods themselves.  If data needs to persist throughout a call, it should be stored either in session or element data.

For more information about how to set and retrieve session and element data, please refer to the Programmer Guide and Audium Java API Javadocs.
Visitor Comments
No visitor comments posted. Post a comment
Related Questions
Attachments
No attachments were found.

Copyright (c) 2005 Audium Corporation. All rights reserved.
Audium Home | Audium Support Center Home | Audium Customer Care Home