Javid Jamae

Author
+ Follow
since May 14, 2008
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Javid Jamae

"Within X days" == "less than (or equal to) today's date + X days"

Does that help?
If you're talking about a service layer that acts as an interface to external systems, you definitely don't want to expose your hibernate model. If you read through Martin Fowler's Patterns of Enterprise Application Architecture, he has a good discussion as to why you don't want to do this.

Primarily:
- You don't want to expose transactions to your client (avoid distributed transactions)
- You want your service layer to be coarse grained to avoid performance issues with distributed calls (no, this is not premature optimization, it is architecture)
- You want to eliminate duplication in code that the clients would have by stringing together find-grained data access calls.

To elaborate on Rahul's answer, most of the id generation strategies don't require you to set the id in code, they know how to generate an ID based on your database.
Don't call the setautoCommit() method at all and see what happens. You should really always manage your transaction, so you should have no need to turn it on.

Are you using straight JDBC in your code?
11 years ago
Welcome to Java Ranch.

Please explain further what you want to do.

Copying a file into the server/xxx/deploy directory should deploy it after the server is running.

Do you want to change the configuration in the EAR file while the server is running and have it hot deploy? You should be able to do this with an exploded directory structure. Deploy the application as a directory structure with the top-level directory having the same name as what you would have if it were an archive (for example myarchive.ear). Then you can change your configuration and touch (or update) the META-INF/application.xml file to trigger a redeploy. If you have any WARs or JARs under the ear, you may want those to be exploded directory structures too.
11 years ago
Try taking the / out of your jndi-name in your jboss-web.xml:

11 years ago
"co" that is in your for loop is not defined in your code. Please show us all your code and put it in a code block so we can read it easier.
Can you show the entire stack trace?
<plug>
If you want to take JBoss 5 for a spin, click on the link for JBoss in Action in my signature and download the first chapter of the book for free. It should get you started. Honestly, the contents in that chapter are not too far off from what you need to get started with JBoss 4.x.
</plug>
11 years ago
Try using:

<use-java-context>false</use-java-context>

after your jndi-name definition in your -ds.xml file.

See: http://javahowto.blogspot.com/2006/08/access-jboss-datasource-remotely-from.html
11 years ago
I can't vouch for it, because I've never used it, but I've run across this before: http://www.geocities.com/richard_hoefter/eclipse2ant/

But if you're starting from scratch on your build environment, why not go with Maven? It can generate your eclipse environment for you, so you don't have to mess around with .classpath and .project definitions, and it can manage all your dependencies for you.
11 years ago
If you're passing the connection around, perhaps your closing it in another method. The best thing to do is to track that down. You might also consider checking if the connection is closed before closing it in your finally block to avoid getting the exception (though I don't know if this is a best practice). :-)

11 years ago
You can use the -c flag to have it use a different server configuration.

Peter is right, if you don't have to use different ports, you might just use different URLs.
11 years ago
Not to sound sarcastic, but if you want your transient state to be persisted, doesn't that make it not transient (i.e. persistent). If you want the state to persist and you want Hibernate to load it, you'll have to map it to the DB.