Closed restagner closed 9 years ago
This is already fixed in master
@graemerocher
This is great news!!
I'm just getting around to reading this information. As noted in this ticket, we are using GORM-Standalone (version 1.1.0.RELEASE) using the following syntax
@Grab("org.grails:gorm-hibernate4-spring-boot:1.1.0.RELEASE")
@Grab("Microsoft:mssql-driver-jdbc4:4.0")
@GrabExclude('org.codehaus.groovy:groovy-all')
// initialize the _list_ of Entities
def init = new HibernateDatastoreSpringInitializer(entities)
// set up the data source connection
def dataSource = new DriverManagerDataSource("${jdbcUrl}", "${dbUsername}", "${dbPassword}")
dataSource.setDriverClassName(SQLServerDriver.name)
init.configureForDataSource(dataSource)
If/when I move to version 3.x.x, can I re-use the same code? If not, could you please provide me with an example of how I may use GORM-Standalone with version 3.x.x?
Yes you can reuse the same code
@graemerocher very nice!!! How about the dependency? At the moment, I'm using
@Grab("org.grails:gorm-hibernate4-spring-boot:1.1.0.RELEASE")
Currently, I do not see the equivalent for version 3.0.3 in Maven Central
@restagner They haven't been published to central but are on Bintray:
https://bintray.com/grails/grails-core/org.grails%3Agorm-hibernate4-spring-boot/view
Thanks @graemerocher ! I'll give that a try
@graemerocher
My apologies for returning to this thread. But, I gave the update a try and it did not work out for me. I've posted questions to the Grails Slack channel as well as posted my issue on stackoverflow (http://stackoverflow.com/questions/32315048/gorm-standalone-throws-hibernateexception). However, I have yet to get a response. That is why I'm back here hoping that you can help me out.
Basically, after upgrading to gorm-hibernate4-spring-boot:4.0.4.RELEASE, I receive the following exception
HibernateException: No Session found for current thread
The stackoverflow link I referenced above has all the details. I hope that you can help out. I'm about ready to give up on the standalone upgrade.
I've been wrangling my brain over the past couple of days with regards to some code I'm attempting to use in GORM Standalone mode. If I run the following code using the grails console command (i.e., using grails 2.4.4)
Everything works as expected. I get data/records added to the master, license and license_master (the join table) tables. Yet, when I attempt to run the same code using GORM in standalone mode ... like so
It fails with the following exception