During learn and experience

۴ مطلب در دی ۱۳۸۶ ثبت شده است

Change jvm heap size

Hi

We can change jvm heap size with following runtime parameter :

java -Xms -Xmx

example :

java -Xms32m -Xmx512m

you can see these links for more parameter(switch) :

http://performance.netbeans.org/howto/jvmswitches/index.html
http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp
http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html
۲۳ دی ۸۶ ، ۱۲:۵۹ ۰ نظر موافقین ۰ مخالفین ۰
سعید زرین فام

Using apt to install one or more .deb files

Hi friends

First create a directory where you will place all your .deb files. For this example, I will use /home/debs. Copy all .deb files to this directory. Change into this directory:

cd /home/debs

Create a Packages.gz file with this command:

dpkg-scanpackages . /dev/null | gzip -c -9 > Packages.gz

Edit to your sources.list file and add a line like this:

deb file:///home/debs /

Update your package lists:

apt-get update

Now you can install your package with apt-get.

۱۶ دی ۸۶ ، ۱۳:۴۴ ۰ نظر موافقین ۰ مخالفین ۰
سعید زرین فام

Access to the dom element on the client side in woodstock components

Hi friends

I had some problem with accessing to the dom element in Netbeans 6 visual web . my problem solved with this post from venky .

thanks venky.
۱۱ دی ۸۶ ، ۱۵:۴۷ ۰ نظر موافقین ۰ مخالفین ۰
سعید زرین فام

owning side of the relationship in JPA

Hi friends

There are some peculiarities with bidirectional relationships in JPA. With all bidirectional relationship types, including one-to-one, there is always the concept of an owning side of the relationship. see this sample :

@Entity
public class CreditCard implements java.io.Serializable
{
@OneToOne(mappedBy="creditCard")
private Customer customer;

public Customer getCustomer( )
{
return this.customer;
}

public void setCustomer(Customer customer)
{
this.customer = customer;
}
}


@Entity
public class Customer implements java.io.Serializable
{
@OneToOne
(cascade={CascadeType.ALL})
@JoinColumn(name="CREDIT_CARD_ID")
private CreditCard creditCard;

public CreditCard getCreditCard( )
{
return creditCard;
}

public void setCreditCard(CreditCard card)
{
this.creditCard = card;
}
}

Although a setCustomer( ) method is available in the CreditCard bean class, it will not cause a
change in the persistent relationship if we set it. When we marked the @OneToOne relationship in the CreditCard bean class with the mappedBy( ) attribute, this designated the CreditCard entity as the inverse side of the relationship. This means that the Customer entity is the owning
side of the relationship.
If you wanted to associate a CreditCard instance with a different Customer , you would have to call setCreditCard( ) on the old Customer, passing in null, and then call setCreditCard( ) on the new Customer:

Customer newCust = em.find(Customer.class, newCustId);
CreditCard card = oldCustomer.getCreditCard( );
oldCustomer.setCreditCard(null);
newCust.setCreditCard(card);

bye.
۰۱ دی ۸۶ ، ۱۴:۲۴ ۰ نظر موافقین ۰ مخالفین ۰
سعید زرین فام