[Mondrian] how to get a fresh connection to the olap server

Khanh Vu kvu at lucidera.com
Wed Apr 11 04:22:56 EDT 2007


I am trying to get a fresh connection to the olap server with a private schema for one of my test case. I called mondrian.test.FoodMartTestCase.getConnection(boolean fresh) with fresh = true. After a chain, mondrian.olap.DriverManager.getConnection(...) get called. Its signature is

public static Connection getConnection(
    Util.PropertyList properties,
    CatalogLocator locator,
    DataSource dataSource,
    boolean fresh)

The comment on top of the method says if fresh is true then a new connection is created; if fresh is false then the connection may come from a pool. However, the body of that method does not make use of the fresh parameter at all. It always returns a new RolapConnection regardless value of fresh. (furthermore, that RolapConnection seems to always try to get the schema from a RolapSchema.Pool). I would highly appreciate if someone tell me why the fresh parameter ends up not being used in that method. 

Also, I would like to modify existing code to propagate that fresh parameter down to the constructor of RolapSchema and manipulate the connectionKey inside the constructor so that new schema will be created for the new connection (instead pulling a cached schema from the pool). Please advise if this would potentially cause problems.



More information about the Mondrian mailing list