>> I still don't understand the "copied = copied && fileSafeCopy(etc)"
assume: fileSafeCopy returns true or false;
prime copied: boolean copied = true;
in a loop:
copied = copied && fileSafeCopy(next file)
which means
new value of copied = old value of coppied && the result of the function
Therefore:
if fileSafeCopy returns true:
newCopied = oldCopied && true
newCopied = true && true
newCopied = true
if fileSafeCopy returns false:
newCopied = oldCopied && false
newCopied = true && false
newCopied = false
The only difference is that we're assigning the result to the same variable that we're checking. It's very similar to saying: i = i + 1, except instead of the + operator, we're using the && operator.
x = x && true
x = x && false
i = i + 1
i = i - 1
It's the same idea.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094806#4094806
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094806
At the same time. This is not flexible enough. If entity.jar gets distributed everywhere with its own persistence.xml that looks something like this:
| <?xml version="1.0" encoding="UTF-8"?>
| <persistence xmlns="http://java.sun.com/xml/ns/persistence"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/persistencehttp://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
| version="1.0">
|
| <persistence-unit name="coolDatabase"
| transaction-type="RESOURCE_LOCAL">
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <jta-data-source>java:comp/env/jdbc/CoolDB</jta-data-source>
| <class>entitypackage.Book</class>
| <properties>
| <property name="hibernate.hbm2ddl.auto" value="create-drop" />
| <property name="hibernate.show_sql" value="true" />
| <property name="hibernate.cache.provider_class"
| value="org.hibernate.cache.HashtableCacheProvider" />
| </properties>
| </persistence-unit>
| </persistence>
|
then every system would "inherit" and would have to respect names like "coolDatabase", hibernate.hbm2ddl.auto would always be set to true and so on.
What I would like is to keep my entities separately from rules on how they could be used. Is it possible somehow?
Thank you.
Yuriy
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094804#4094804
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094804
Getting a few thread dump might help pinpoint where in the application the problem is. I recall helping one customer whose system was showing 80% CPU usage when no sessions were active. Turns out that the application code had an infinite loop, and three of the requests were in that loop. Doing several dumps in a row an noticing that those three threads were still in the same code after a couple of minutes helped to pinpoint the problem.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094802#4094802
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094802