For some reason, the output of this:
public void msgNeedParts() {
// Blabla...
System.out.println(name + ": Try to print 'tasks'...");
synchronized(tasks) {
System.out.println(name + ": Tasks--" + tasks);
System.out.println(name + ": Did I manage to print it?");
tasks.add(new BinToDump(feeder, binNum...
Can someone help me with the settings required for enabling global transactions on a queue listener and data source. I am able to achieve it with database, but my listeners stop working
I am using following configuration for it:
<tx:jta-transaction-manager/>
<jms:listener-container connection-factory="jmsConnectionFactory" transaction-...
session.open
insertIntoTODB()
getList()
session.close
session.open()
getList();
sesson.close()
1st leve cache is only bounded in session open and close and for 2nd subsequent session open, getList() will get from DB instead of cache?
...
Let's say I have a recursive data structure
class Tree {
private Tree right;
private Tree left;
private int data;
....
}
I want to convert it to xml with jsp, so my ui tree widget can load the xml page with Ajax and construct a tree (with expandable/collapsable nodes, etc).
The xml would look something like ...
for first level of cache, what i understand is when we do saveorupdate , we need to call flush() to refresh the cache in order for subsequent select query from DB. So, for application using hibernate, we should not modify records/delete records using DB-GUI without going through hibernate as the select will query wrong result because of ...
1.for 2nd level cache, can only set timeout period but cannot force refresh/clear cache of entity? or putthing annotation @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) like auto refresh/clear the cache each time doing saveorupdate/mergeupdate? what is hibernateTemplate.flush() relate to this?
2. is it good to enable 2n...
Can someone help me to open an existing Java project using Eclipse or Netbeans?
It's a specific project on SourceForge, SMPPClientServer.
All I want to do is to just get this project to run. But, this seems like a challenge at the moment as I'm totally new to Java (I'm a C#.Net developer).
...
Hi !
I am trying to validate a rich:calendar for not null input using <rich:beanValidator />, but i am not able to validate for null inputs.
For example in my constraits.xml file, i validate getter for calendar:
<getter name="dateOfBirth">
<constraint annotation="javax.validation.constraints.Past"/> (works fine)
<constraint anno...
Hey guys
I am working on a project, in java, where the user has to choose a file to be uploaded through a jfilechooser. Is there anyway to make the textfield readonly so that you can only choose files by clicking them, and not by writing in the textfield. I hope that i made my problem clear ;D
...
I was looking around to see if there is an equivalent to django/RoR in java.
I found:
Play Framework
Grails
Does anyone have ever tried those frameworks, or do you know any other?
Are they faster than django/RoR?
...
Writing some additional classes for an existing GWT project. I need to:
Request a URL
Read in the webpage returned, in order to perform operations on.
The returned page is in very simple HTML, therefore parsing it shouldn't be very difficult, I just need to get the data first.
How do I do this in Java? What packages am I best lookin...
I have a problem with DB2 databases that should store unicode characters. The connection is established using JDBC.
What do I have to do if I would like to insert a unicode string into the database?
INSERT INTO my_table(id, string_field) VALUES(1, N'my unicode string');
or
INSERT INTO my_table(id, string_field) VALUES(1, 'my unicod...
Is there any neat solution of knowing when a thread has been put into wait status? I am putting threads to wait and I notify them when i need it. But sometimes I want to know if a thread is currently waiting, and if so, I have to do something else.
I could probably set a flag myself to true/false. But I can't imagine there is a better w...
How do I compile and run a servlet from the Command Prompt?
I got an error when I tried to compile using Apache Tomcat 6.0.16.
What is the exact command I should be using?
...
Today I faced an interesting issue. I've been having an inheritance hierarchy with Hibernate JPA, with SINGLE_TABLE strategy. Later, I added a superclass to the hierarchy, which defined TABLE_PER_CLASS strategy. The result was that the whole hierarchy stared behaving as TABLE_PER_CLASS. This, of course, seems fair, if we read the @Inheri...
i am new to Netbeans, i created the web project,
now i want to write javascript for one html page,
how should i write,
...
I have the understanding that perm size is used to store meta data, that would include byte code, static stuff etc.
My question how does usage of reflection affect the perm size, if it ever does.
I mean if Program-A uses normal way of running objects and Program-B uses reflection all over, how will the perm-sizes of the two programs com...
I notice a number of java libraries use this as a suffix:
log4j, couchdb4j, neo4j, launch4j, etc..
...
Hi,
I'm tasked with creating a Java Web Service for a .NET 2.0 client to consume.
What would your suggestions for the implementation be?
The solution doesn't need to be very heavyweight (don't need a full Java EE container I believe) but what do you think is the best solution for this? I have thought about using Glassfish v2 with JAX-...
I want to convert exponential to decimal. e.g. 1.234E3 to 1234.
...