Posts

hibernate - How to save without locking all the tables on grails -

i have domain class using domain class property city : class tracker { string name, value; city city; int hits; date date; } and insert or update values using tracker.save(); in long job procedure. that working fine except when want update on city domain class while tracker saving something. , says lock wait timeout exceeded; try restarting transaction. stacktrace follows: message: lock wait timeout exceeded; try restarting transaction i don't make changes in city when saving tracker, think hibernate thinks , lock city domain too. try tracker.save(flush: true) or flush session after updates: def sessionfactory sessionfactory.currentsession.flush()

java - How to go from JOptionPane program to GUI interface -

for simple card game making, make gui in can play card game. previously, relying on joptionpane's show me drew. now, don't know how draw card gui made using swing interface in netbeans. i'd know best way implement original drawing method in button netbeans generated gui code. thank you! here's drawing method: public static void draw() { system.out.println(player1 + " drew " + suits[cardsuit(deck1[deck1cardposition])] + " of power " + (cardpower(deck1[deck1cardposition]))); joptionpane.showmessagedialog(null, player1 + " drew " + suits[cardsuit(deck1[deck1cardposition])] + " of power " + (cardpower(deck1[deck1cardposition]))); system.out.println(player2 + " drew " + suits[cardsuit(deck2[deck2cardposition])] + " of power " + (cardpower(deck2[deck2cardposition]))); joptionpane.showmessagedialog(null, player2 + " drew " + suits[cardsuit(deck2[deck2cardposition])] + " of powe...

DB2 nickname doesn't support decfloat type? -

i created table columns of datatype decfloat , when tried create federated nickname table so: create server crv_test type db2/udb version '9.7' wrapper drda authorization "xxx" password "xxx" options ( dbname 'xxx' ); create user mapping db2inst3 server crv_test options ( remote_authid 'xxx', remote_password 'xxx' ); create nickname xx.xx crv_test.xx.xx; i got error below: db2 database error: error [] [ibm][db2/aix64] sql3324n column "paymoney" has type of "decfloat" not recognized. my remote db2 version 9.7 , local 9.5. have suggestion solve problem? interestingly, documented limitation of federated wrapper version 9.5: the data source data types correspond following db2 data types not supported of wrappers: xml, decfloat, structured types, , ref types. federation support in db2 has lagged behind engine development, in case support decfloat . if running lates...

javascript - Changing object in Array -

var tab = new auitab({ element: document.getelementbyid("footer"), index: 1, repeatclick: false }, function(ret) { if (ret.index == 1) { bottomnav1(); } if (ret.index == 2) { var login_name = $api.getstorage('mobile'); if (typeof(login_name) != "undefined") { profile(); } else { login(); auitab.index = 1; } } }); i want change index value in array. can see, tried updating using auitab.index = 1 , tab = 1 (one of them should've worked according google). both did not work - new programming. there not aware of?

java - Whats the difference between ActionContext,ServletContext and ServletActionContext? -

in java ee, use actioncontext , servletcontext , servletactioncontext , have similar name, don't know difference between them. i know servletactioncontext inherit actioncontext . can explain them? there have many difference between them. servletcontext from servletcontext 's package( javax.servlet.servletcontext ) can know standard javaee webapplication class library. servletcontext provides standard servlet run-time environment. methods of servlet communicate web container. public interface servletcontext { // returns url prefix servletcontext. public string getservletcontextname(); //returns context-path web-application. public string getcontextpath(); //returns servletcontext uri. public servletcontext getcontext(string uri); //returns real file path given uri. public string getrealpath(string uri); public requestdispatcher getnameddispatcher(string servletname); public requestdispatcher getrequestdispatcher(string uri); servletcon...

regex - Pass Java backreference to method parameter -

i need java port of https://gist.github.com/jbroadway/2836900 , simple markdown regex parser in php. i hoping use backreferences, can't make work. @ moment i'm not using hashmap , i've got 2 javafx textarea s i'll , set text via changelistener . { //... htmltextarea.settext(markdowntextarea.gettext() .replaceall("(#+)(.*)", header("$0", "$1", "$2")); } private string header(string text, string char, string content) { return string.format("<h%s>$2</h%s>", char.length(), char.length()); the backreference on $2 works, if returned, other backreferences don't. char.length() 2 since it's treated $2 , not backreference. id think of solution can keep style , don't need handle separately. the problem backreference values honored in replacement string. such, values passed header() method $0 , $1 , $2 literals , not captured values. since there's no version of replace...

Winform combobox binding and setting default value with selected index -

i have case databatable datasource combobox , datatatable records change user selects field. want set default value in combobox when database has 1 record. works when write cmblist.items.count > 0 cmblist.selectedindex = 0 but loses focus goes blank. seems setting selectedindex 0 not update bindingsource values. what's solution please