This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
groovy> import es.coftal.dominio.* | |
groovy> def u = new Usuario(login:'emedina1', password:'sldkslkdlks') | |
groovy> try { | |
groovy> Usuario.withSession { session -> | |
groovy> session.writeConcern = com.mongodb.WriteConcern.SAFE | |
groovy> try { | |
groovy> u.save(failOnError:true) | |
groovy> } | |
groovy> catch (e) { | |
groovy> println "CAUGHT EXCEPTION!!!!!! = " + e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
groovy> import es.coftal.dominio.* | |
groovy> def u = new Usuario(login:'emedina1', password:'sldkslkdlks') | |
groovy> try { | |
groovy> Usuario.withSession { session -> | |
groovy> session.writeConcern = com.mongodb.WriteConcern.SAFE | |
groovy> try { | |
groovy> u.save(flush:true, failOnError:true) | |
groovy> } | |
groovy> catch (e) { | |
groovy> println "CAUGHT EXCEPTION!!!!!! = " + e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
groovy> import es.coftal.dominio.* | |
groovy> def u = new Usuario(login:'emedina1', password:'sldkslkdlks') | |
groovy> try { | |
groovy> Usuario.withTransaction { status -> | |
groovy> status.transaction.sessionHolder.session.writeConcern = com.mongodb.WriteConcern.SAFE | |
groovy> try { | |
groovy> u.save(failOnError:true) | |
groovy> } | |
groovy> catch (e) { | |
groovy> println "CAUGHT EXCEPTION!!!!!! = " + e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
groovy> import es.coftal.dominio.* | |
groovy> def u = new Usuario(login:'emedina1', password:'sldkslkdlks') | |
groovy> try { | |
groovy> Usuario.withTransaction { status -> | |
groovy> status.transaction.sessionHolder.session.writeConcern = com.mongodb.WriteConcern.SAFE | |
groovy> try { | |
groovy> u.save(flush:true,failOnError:true) | |
groovy> } | |
groovy> catch (e) { | |
groovy> println "CAUGHT EXCEPTION!!!!!! = " + e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package unittestfailwithobjectid | |
import grails.test.* | |
import grails.datastore.test.DatastoreUnitTestMixin | |
import org.bson.types.ObjectId | |
import org.springframework.core.convert.converter.Converter | |
@Mixin(DatastoreUnitTestMixin) | |
class SampleTests extends GrailsUnitTestCase { | |
protected void setUp() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Atmosphere1Service { | |
static transactional = false | |
static atmosphere = [mapping: '/atmosphere/atmosphere1'] | |
def onRequest = { event -> | |
event.suspend() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Controller1Controller { | |
def atmosphere1() { | |
broadcaster['/atmosphere/atmosphere1'].broadcast("MY BROADCAST MESSAGE") | |
render "DONE BROADCASTING MESSAGE" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"took": 5, | |
"timed_out": false, | |
"_shards": { | |
"total": 5, | |
"successful": 5, | |
"failed": 0 | |
}, | |
"hits": { | |
"total": 5, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPUT http://localhost:9200/_river/test_mysql_river/_meta -d ' | |
{ | |
"type":"jdbc", | |
"jdbc": { | |
"strategy":"simple", | |
"poll":"1m", | |
"driver":"com.mysql.jdbc.Driver", | |
"url" : "jdbc:mysql://localhost:3306/ohim", | |
"user":"root", | |
"password":"", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove all data. | |
curl -XDELETE 'http://127.0.0.1:9200/poc/' | |
# Create index with default settings. | |
curl -XPUT 'http://127.0.0.1:9200/poc/' | |
# Define mapping for taskA. | |
curl -XPUT 'http://127.0.0.1:9200/poc/taskA/_mapping' -d ' | |
{ | |
"taskA": { |