Configuration.getInstance() messes up an existing Resultset during lazy initialization

Description

When Configuration is getting initialized, it picks up the default currency
using AccountingRules.getMifosCurrency(), which is actually a database call.

If this process is done when an active ResultSet exists due to a just-executed
query, the ConfigManager code overwrites this ResultSet. I'm seeing this error
when I call FeePersistence.getUpdatedFeesForCustomer() which uses the
MoneyCompositeUserType when generating the result.

This is the call stack:
Configuration.getInstance()
Configuration.initialize()
ConfigurationInitializer().initialize()
ConfigurationInitializer().createSystemConfiguration()
AccountingRules.getMifosCurrency()

I'll be attaching a test case which uses
FeePersistence.getUpdatedFeesForCustomer() to reproduce this bug. Also
find stack trace attached.

Environment

Platform: All, OS: All

Activity

Show:
aliyaw
May 21, 2008, 7:14 PM

Triage comments - this can be fixed after v1.1. Pramod - please indicate if
there is a specific reason you think this needs to be addressed sooner.

pbiligi
May 22, 2008, 5:32 AM

This can be fixed in the next version. As far as I see, this bug only affects
Hibernate derived user types, in the case where they are used before the
Configuration object is initialized.

Jeff Brewster
January 26, 2010, 5:44 PM

Van, can you tell if this issue is still valid?

Van Mittal-Henkle
January 27, 2010, 6:53 PM

Test attachment adapted to work with current Mifos code.

Van Mittal-Henkle
January 27, 2010, 6:55 PM

The test code passes when compiled and run against mifos r16640.

Cannot Reproduce

Assignee

Van Mittal-Henkle

Reporter

pbiligi

Labels

None

URL

None

Story Points

None

Team

None

Scheduled For

None

Epic

None

Notify

None

productboard URL

None

Man Day Estimate

None

Components

Fix versions

Affects versions

Priority

Minor
Configure