I'm using Hibernate backed JPA as my persistence layer. I have a multi-threaded process that aggregates data from a Soap call and then stores a row in a database. The process usually ends up inserting about 700 rows and takes about 1 - 3 hours, with the Soap calls being the main bottleneck.
During this entire process the table I am ins...
Hi.
I have a list of objects of the same class. The order of the list is not important.
What i want to do, is to (using bitwise operations) determine whether i should set some field with an incremental value or not. But the trick is that i want need this operation to return false (must not set field) only for the first element.
for (Ob...
Hello,
I have an JSF/ICEFaces application that is works fine but I keep getting this error. Although the application continues normally, I still get that error now and then. As far as I understand it's complaining about having something in the file before XML header but I'm not sure why I'm getting this I'm using ICEfaces that generates...
A co-worker ran into an interesting issue today, and while I think the actual, big-picture answer is "the fact that we're having this problem means we're doing something wrong", I figured I'd ask this anyway.
Given the following:
public class CrazyEnumTest {
public class EnumeratedThing<T extends Enum<T>> {
public T myValue;
...
We have a C++ application on Windows that starts a java process. These two apps need to communicate with each other (via snippets of xml).
What interprocess communication method would you choose, and why?
Methods on the table for us are: a shared file(s), pipes and sockets (although I think this has some security concerns). I'm open to...
Hey there,
I started a personal Java WEB project and I'm trying to generate some documentation before I start off.
I'm looking for some cool, flexible and free Diagram tool.
Cool -> Shapes are colorful and could be used to be presented directly to a client.
(Those line based- black/white are awful)
Flexible -> I'm looking for somethi...
I have a thread and I need to wait for its result, like this:
t1.start();
while (variableModifiedByMyThread == null) {
/* do nothing */
}
// "t1" set the value of "variableModifiedByMyThread"
The code above is working, but not a very nice solution...
Is this code doing the same thing (is it waiting for the "t1" thread)?
t1.start...
The JAI setup is quite tedious, involving multiple jars and environment variables. It would aid the project's portability quite a lot if I could add it as a regular Maven dependency.
The POM snippet I'm using is
<dependency>
<groupId>com.sun.media</groupId>
<artifactId>jai_imageio</artifactId>
<version>1.1</version>
</dependency>...
I remember eclipse and idea have this template to automatically create an object's hashCode based on its attributes.
One of the strategies if a number and a string is used is something like this.
return stringValue.hashCode() + intValue * 32;
Ooor something like that.
I don't have nor eclipse or idea at hand and I would like to cr...
Is the standard MySQL JDBC driver thread-safe? Specifically I want to use a single connection across all threads, but each statement will only be used in a single thread. Are there certain scenarios that are safe and others that aren't? What's your experience here?
...
Hi all, I'm working a web project that use:
- Java
- Jetty
- Fitnesse tool
- etc..
I have a difficulty to simulate/generate a SocketTimeoutException, more info below:
The use-case-simplified:
I wrote a API that make calls to a host(WebServer).
In the source-code if I receive a RemoteException and is a SocketTimeoutException, I nee...
Hi. I am trying to access a url, get the html from it and use xpaths to get certain values from it. I am getting the html just fine and Jtidy seems to be cleaning it appropriately. However, when I try to get the desired values using xpaths, I get an empty NodeList back. I know my xpath expression is correct; I have tested it in other way...
Hey folks. Trying to parse rss/atom feeds with the ROME library. Need some help. I am new to java so I am not in tune with many of it's intricacies.
2 things.
Does ROME automatically use it's modules to handle different feeds as it comes across them, or do I have to ask it to use them. If so, any direction on this.
How do I get to ...
When you create a Service bean or Dao bean in your Spring applicationContext.xml file, what is the scope of those beans?
Will every person who accesses the web application use the same instance of the bean, or is the bean instantiated for each user's session?
...
What is the Java equivalent of Cocoa delegates?
(I understand that I can have an interface passed to a class, and have that class call the appropriate methods, but I'm wondering if there is any other way to achieve something closer to Cocoa/Objective-C's informal protocols)
...
My castor masrshaller have an XML output as below
root>
field1 /field1>
field2 /field2>
..........
fieldn>
collection>
field>
field>
..........
field>
/collection>
/root>
my mapping for the collection part is
field name="collectionObj" type="string" collection="arraylist">
bind-xml name="...
How can I see how much time it took for the code to run in InteliJ?
...
I have a Java program that is mostly GUI and it shows data that is written to an xml file from a c++ command line tool. Now I want to add a button to the java program to refresh the data. This means that my program has to call the c++ functionality.
Is the best way to just call the program from java through a system call?
The c++ progr...
I'm trying to work out the best way to setup our multi-module Apache Maven project in a way that allows for disparate release cycles of modules, and doesn't introduce dependency issues when debugging the project.
We currently have a setup along the lines of:
[email protected]
parent-1.1-SNAPSHOT
module [email protected]
parented by parent@...
Am I correct in saying that a .Net Hashtable is not synchronized while a Java Hashtable is? And at the same time a Java HashMap is not synchronized and has better performance?
I am rewriting a Java app that makes heavy use of HashMaps in C# and I would like to use a HashTable and ensure that the performance is basically equivalent.
...