Advanced Customization > Info*Engine User’s Guide > Info*Engine Custom Tag Reference > Info*Engine Tags > Core Library Tags > resetService
  
resetService
The resetService tag resets the Info*Engine object (com.infoengine.jsp.InfoEngine) that is being used by the Info*Engine custom tags on a JSP page or in a session. If you include a page scope, the reset object exists only while the page executes. If you specify a session scope, the reset object is available to all pages in the session.
When you reset an Info*Engine object using a page scope, the following things happen:
All VDB groups that were available to the page are no longer available in the new object.
All VDB groups created after the object is reset are only available to the page (even if the page directive for the page includes session=TRUE).
You can copy a group from a session VDB to a page VDB or from a page VDB to a session VDB using the addGroup method from the com.infoengine.object.factory.Group class.
When you reset an Info*Engine object using a session scope, all VDB groups that were available to the session are no longer available in the new object.
Unless you explicitly save an existing Info*Engine object, the existing object is no longer available when you reset the object using the resetService tag.
If you supply a new variable name for the reset object, the new service object can be referenced by the name in code that uses methods from the Info*Engine Server Access Kit (SAK). For example, you can access VDB information, retrieve groups, format rows and columns, and so on.
The resetService tag can be very useful in the following situations:
Avoiding conflicts when accessing groups in the VDB. You may need to do this when an application that consists of multiple JSP pages has session scope and there can be multiple requests for VDB groups occurring at the same time. Ensuring that each request gets back the intended groups may not be possible unless you reset the Info*Engine object for each page. This allows you to restrict the groups available in the VDB to those created on the page while setting other information to a session scope.
Cleaning up the VDB. When your application has created many VDB groups that are no longer needed by the application, you can reset the VDB to free up resources.
* 
Only use this tag on JSP pages; do not use it in standalone Info*Engine tasks.
You can include multiple resetService tags on the same page as long as you either omit the variable name or specify unique object names. You cannot specify the same variable name on multiple resetService tags, or conversely on a getService tag and a resetService tag.
This tag cannot be embedded within other Info*Engine tags.
Syntax
<ie:resetService varName="variable_name"
scope="[PAGE | SESSION]"/>
Attribute Descriptions
varName
Specifies a Java variable name for the Info*Engine object. This tag defines the variable; do not define it before specifying the name here. The variable name cannot be the same name specified in either the getService tag or other associated resetService tags.
This attribute is optional. If omitted, the object cannot be referenced through SAK methods.
scope
Specifies where the Info*Engine object is stored. The valid values for scope are:
PAGE—Sets the object scope to the page in which the tag is used.
SESSION—Sets the object scope to the session in which the tag is used.
This attribute is optional. If omitted, the value defaults to the location of the Info*Engine object in use. If session=true on the page directive, then the session Info*Engine object is reset. Otherwise, the page Info*Engine object is reset.
Example
The following example declares that the page has a session scope and uses tags from the Info*Engine core tag library and that the tags have the ie prefix. The example expands on the getService tag example which gets the number of rows in the “EMPLOYEEdata”. The example resets the service object for the page using the resetService tag and continues on with other queries:
<%@page language="java" session="true" errorPage="../IEError.jsp"%>

<%@ taglib uri="http://www.ptc.com/infoengine/taglib/core"
prefix="ie" %>
<html>
<body>
<!-- perform a query -->
<ie:webject name="Query-Objects" type="OBJ">
<ie:param name="INSTANCE" data="jdbcAdapter"/>
<ie:param name="CLASS" data="EMP"/>
<ie:param name="WHERE" data="()"/>
<ie:param name="GROUP_OUT" data="EMPLOYEEdata"/>
</ie:webject>

<!-- display how many elements were returned -->
<ie:getService varName="ieObj"/>
<P>Search returned
<b><%=ieObj.getElementCount()%></b> employees.</P>

<!-- reset the VDB for the page -->
<ie:resetService varName="ieObjII" scope="PAGE"/>
<!-- perform additional queries -->
.
.
.
</body>
</html>
* 
Because the resetService tag only resets the service for remainder of the page, at the end of the page processing, the session VDB still includes the “EMPLOYEEdata” group.