Mykola Makhin

Greenhorn
+ Follow
since Feb 05, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mykola Makhin

Maybe you should've used paintAll instead of printAll
2 years ago
I don't understand your harshness people, you fail at explaining the issue, yet are angry at the person you're trying to explain it to.

@Dm Laf, if you're still there:
Thing is inside Date you have something similar to UNIX timestamp, i.e. number of seconds since 1-st of Jan 1900 00:00:00 GMT or something similar.
Naturally, this number is the same for every timezone.

As established already, Date has no timezone in it, so going from Calendar.getInstance(whateverTimezone).getDate() always returns the point in time when calendar was created, as a number of seconds since 1900 it will be the same number for all timezones. Thus there is no bug. Just a bad naming - Date isn't really a date, it's a timestamp.

The problem is indeed in toString() method of Date, and the problem is that it doesn't allow you to specify a timezone you want to represent date in. There's no toString(TimeZone tz) while there could be.
It's a bit silly that toString uses timezone, but always takes the default one and actually shows it (for example, for me it now returns "Tue Aug 06 14:25:44 EEST 2013", note the "EEST" part - this is my default timezone, and I can't tell Date.toString() to use any different than that).

If there would be such method as Date.toString(TimeZone tz) , Date.toString() could be implemented like "return this.toString(TimeZone.getDefault())".
Something like new String(bytes) uses default charset, while there is an alternative new String(bytes, charsetName).

But since there isn't such method, the only alternative is using DateFormat to take the Date (i.e. number of seconds since 1900) and represent it in timezone specific manner.

P.S. Perhaps I should conclude with the example of what I propose:
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
java.util.Date now = new java.uitl.Date();
sdf.setTimeZone(TimeZone.getTimeZone("GMT+3"));
System.out.println(sdf.format(now)); // ===> 2013-08-06 15:32:45
sdf.setTimeZone(TimeZone.getTimeZone("GMT+1"));
System.out.println(sdf.format(now)); // ===> 2013-08-06 13:32:45

As you can see, I've managed to get 2 hours difference in representation of same timestamp for GMT+3 and GMT+1. Hope this help you.
10 years ago
Ok, I've found the solution on StackOverflow: http://stackoverflow.com/questions/3551988/hsqldb-and-hibernate-jpa-not-persisting-to-disk

To make HSQL save data to disk immidiately I've added these properties to JDBC DB URL:
;shutdown=true;hsqldb.write_delay=false;

Seems to be working fine now.
P.P.S. Some details:
Versions (from maven pom.xml):


Spring config (spring version is irrelevant I suppose):


The hibernate.cfg.xml:


The x.mvmn.blah.model.impl.BlahImpl:


Running code


With hibernate.hbm2ddl.auto set to create outputs this:
[Ljava.lang.Object;@12b27c38
[Ljava.lang.Object;@3f94a1f
[Ljava.lang.Object;@63713b42

With hibernate.hbm2ddl.auto set to validate, complains that table doesn't exist.
I'm having same problem. Did you find the solution?

P.S. Guys, do you even read?

Mark Spritzler wrote:But more as an FYI, Hypersonic is run in-memory, so when you shut down JBoss all the tables and data will be lost.


Rich Morrison wrote:jdbc:hsqldb:file:c:\temp\productsDB\products_t



Santosh Ramachandrula wrote:comment this out or use validate instead of create


Rich Morrison wrote:I tried turning off "hibernate.hbm2ddl.auto" and I tried ";shutdown=true" after the url, based on comments on other sites.




I see. Thanks for your answer, will concentrate on only 2009 and later docs.
14 years ago
Ok, I guess this - http://www.weiqigao.com/blog/2008/08/05/watch_javafx_sdk_run_on_linux.html - partially answers my question.

"One thing that people noticed right away is the fact that the JavaFX Preview SDK is available for Windows and Intel/Mac, but not Linux or Solaris. A cursory examination of the Windows and Mac OS X version of the JavaFX Preview SDK reveals that they are almost identical in content. The only differences are in native libraries and startup scripts/executables. The native libraries fall into the area of native audio/video playback and (for Windows) some 3D effects."

14 years ago
Hails people

Sorry if this is a stupid question, but can someone please explain to me in a bit more details what JavaFX really is.
For example, if one'd ask me what Java is I'd say it's a platform that consists of several key components:
- specification of java virtual machine and java bytecode run by this VM + platform specific implementations of VM.
- specification for java language + platform specific implementations of Java compilers, that make a bytecode out of sources.
- java class library classes - standard mostly "pure-java" classes (+ some JNI calls) that ship with JVM and provide basis for developers to build on.
Something like this.

If this is too blurry, I can ask some specific questions about JavaFX - is it purely platform independent or there are platform-specific implementations? What it consists of: pure java classes or something else too?
If platform-specific, which platforms are supported and why?
14 years ago