Skip to content

Conversation

atallahade
Copy link
Member

@atallahade atallahade commented Jan 2, 2019

Issue

https://jira.xwiki.org/browse/XWIKI-8286

Changes

  • Upgrade to Hibernate 4.0.1.Final.
  • Use the new hibernate package names.
  • Replace the 'session.connection()' with either 'session.doWork()' method or by directly creating an sql query.
  • Adapt the DBCPConnectionProvider using C3P0ConnectionProvider as a model.

Notes

Not everything could have been properly tested, especially migration classes.

The migration was made using:

// save object using the custom mapping
Map<String, Object> objmap = object.getCustomMappingMap();
handledProps = bclass.getCustomMappingPropertyList(context);
Session dynamicSession = session.getSession(EntityMode.MAP);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not valid anymore and I'm not sure what will be the consequence of the removal.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Configuration config = getConfiguration();
SessionFactoryImpl sfactory = (SessionFactoryImpl) config.buildSessionFactory();
Settings settings = sfactory.getSettings();
ConnectionProvider provider = ((SessionFactoryImpl) getSessionFactory()).getSettings().getConnectionProvider();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The connectionProvider is not part of the settings anymore so setting it doesn't seem to be needed.

* Upgrade to Hibernate 4.0.1.Final.
* Use the new hibernate package names.
* Replace the 'session.connection()' with either the
  'session.doWork()' method or by directly creating an sql query.
* Adapt the DBCPConnectionProvider using C3P0ConnectionProvider as a
  model.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant