Use DbSessionFactory and DbSession

Hi, so I made this Pull Request trying to introduce Dbsession and DbsessionFactory,

Been trying to make sense of the error I also get locally of a cannot find symbol. Importing DbsessionFactory doesn’t seem to do the trick as if it is missing in core

Could I be missing something here @dkayiwa @ruhanga

can you paste thefull error log in paste bin ?

The “Cannot find symbol” errors generally occur when you try to reference an undeclared variable in your code. A “Cannot find symbol” error means that the compiler cannot do this. Your code appears to be referring to something that the compiler doesn’t understand.

But am seeing travis is failing because of a different reason. have you looked at No more oracleJDK . ??

This is the error log I get locally I also know what the cannot find symbol means, except that how am I getting this error even after importing the DbsessionFactory

I can have that changed

Upgrade openmrsVersion to atleast 1.9.9:

EDIT

DbSessionFactory was introduced in 1.12 and possibly backported to versions: 1.11.3, 1.10.2, 1.9.9 see: https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/api/db/hibernate/DbSessionFactory.java#L21

This means it’s not available in prior versions!

~Samuel

2 Likes

Thanks for that link @samuel34 that went well, though looking through the error logs there seems to be an error with the test class MetadataUtilsTest showing this

org.openmrs.module.metadatadeploy.MissingMetadataException: No such Location with identifier 'dc5c1fcc-0459-4201-bf70-0b90535ba362'

Been looking around, not sure why there is an error in this test class, seems to be a problem with getLocation for a Dbsession

I guess those are broken tests as a result of upgrading core! There fixable @odorajonathan :smile:

I think those are low hanging mangoes for you to pick :wink:

1 Like