Hello.
I don’t have any figures to base this on, but I would expect that it takes longer to connect and create an Accessor than it does to create an Accessor from an existing Connection.
If this is true, then it would seem safe to assume that it will be slower to connect [unnecessarily] in order to change Collection.
As Christian pointed out, once a TConnection object exists it can be used to create an Accessor to any Collection in the database it is connected to…
Could you perhaps re-design your Database class a little so that it is possible to change the Collection/Accessor without calling the constructor?
I am thinking about adding a method something like this:
public void setCollection(String newCollection) {
accessor = connection.newXMLObjectAccessor(TAccessLocation.newInstance( newCollection ),
TJDOMObjectModel.getInstance() );
}
Of course, this might not be possible/appropriate, depending upon how the rest of the Database class is designed and implemented.
Cheers,
Trevor.
#webMethods-Tamino-XML-Server-APIs#API-Management#webMethods