File structure, entity (object) relationship, connection / session / transaction management all decided by the architect. An intermediate developer can add a new column to the mapping (hehe, 照葫芦画瓢的那种)。
-wukongjj(不经历风雨怎么见彩虹);
2009-10-28(#5640619@0)
For the N-tier web app running in an app server, lazy loading is useless. And by default, we always set it to false.
-wukongjj(不经历风雨怎么见彩虹);
2009-10-28(#5640620@0)
i don't understand this. there is lazy setting both in JPA and hibernate. They are useless if it is a n-tier web app? are you sure?
-rune(矿泉水);
2009-10-29(#5641923@0)
Java is totally crap. Move to .NET
-oceanwater(灌水日月长);
2009-10-28(#5640682@0)
Yes, the technologies in the Java horizon are now a little complicated. but they are also powerful. .NET is "too simple, sometimes naive". Believe or not, most enterprise computings rely upon Java ( and C++ which is more complicated than Java).
-james05(关不上的窗);
2009-10-28(#5640689@0)
It's not complicated, it's crappy
-oceanwater(灌水日月长);
2009-10-28(#5640694@0)
I have to disagree.Java is about choice, vendor independence ( or excellent portability to other vendor, to be accurate), excellent enterprise integration capabilities.
-james05(关不上的窗);
2009-10-28{149}(#5640696@0)
Mind to tell us more specific how and what .Net is crappy!
-hkchan(0);
2009-10-28(#5640745@0)
Well, this cannot be translated to "Java is totally crap". In terms of cost, .NET is way cheaper - for contracting in Canada, it's around $50-65/hr vs Java $60-80/hr. Blame the recession, rather than the technologies.
-james05(关不上的窗);
2009-10-28(#5640707@0)
Java shop is Costco, .net is Wal-Mart.
-nicetomeetyou(蓦然回首彩虹跨天地);
2009-10-28(#5640719@0)
:)
-skitennis(tennisfan);
2009-10-30(#5646187@0)
why? What .Net is better than Java?
-hkchan(0);
2009-10-28(#5640748@0)
Core Java is good, jdbc, jsp are ok. EJB, Hiberate, Structs, Spring are all crap.
-oceanwater(灌水日月长);
2009-10-28(#5641136@0)
This is what's in Hibernate text book.Session sess = factory.openSession();
Transaction tx;
try {
tx = sess.beginTransaction();
//do some work
...
tx.commit();
}
catch (Exception e) {
if (tx!=null) tx.rollback();
throw e;
}
finally {
sess.close();
}
-james05(关不上的窗);
2009-10-28{267}(#5641530@0)
And this is my design . tx.beginTX() / .commit() / .rollback(); sess.close() are never used in my code. They are all handled by WebSphere / WebLogic. My Hibernate never interacts with HTTP Session.Session sess = getSession(); // a single DB TX can span multiple getSession() calls
//do some work;
// NO tx.beginTX() / .commit() / .rollback(); nor sess.close() in the code.
If you rely on the container, how can you tell the container does not associate hibernate session to http session in some cases? In reality, EJBe containers all support extended persistent context (see JPA), which is the same concept.
-majorhomedepot(马甲后的炮);
2009-10-28(#5641622@0)
transaction should be managed by some container, like EJB contiainer or sping, you also can handle transaction in your code,like trans.commit(), trans.rollback();....
-popwang(梦回上海);
2009-10-29(#5643688@0)
use @TransactionAttribute(TransactionAttributeType.NEVER)
-wuyg719(wuyg719);
2009-10-31(#5646948@0)
绑定your Hibernate Session in your HttpSession 应该是不好的,以下内容转帖自http://www.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/4.2.0.cp07/html/Hibernate_Reference_Guide/Transactions_And_Concurrency.html
If you keep your Hibernate Session in your HttpSession (discussed later), you should consider synchronizing access to your Http session. Otherwise, a user that clicks reload fast enough may use the same Session in two concurrently running threads.
-who8mylunch(java中年失业男);
2009-10-30{411}(#5644752@0)
只要能进去,就说明你行。所以,聪明写简历,聪明应面试。如果进去被layoff,就是关系没有搞好.. rule I: dont be aggressive rule 2 be a productive team member rule3 follow supervisor instructions
-readingbook(seaseasea);
2009-10-28(#5641620@0)
Can I ask a very simple question? I have not done web development / Java more than 6 years. So I like to know why we should use persistent objects / hibernate?
-hkchan(0);
2009-10-30(#5644613@0)
because plain JDBC looks dumb, dude.
-crashingwaves(CherryHill);
2009-10-30(#5645091@0)
If it doesn't take too much time, can you please give me an exmaple the benefits of persistent object / hibernate?
-hkchan(0);
2009-10-30(#5645203@0)
By representing data in objects, you got the flexibility of handling the data in the object oriented way (presumably advantageous from the software development perspective). OtherwiseYou have to embed SQL scripts in your code to handle data manipulation logic -- which are consider "eye sore" by many developers; or to call stored procedures-- which is harder to refactor.
The above is just my understanding -- there could be more.
That said -- nowadays, frenquently the business has the say in software development, and they typically just want the currently prescribed functionality deliver fast and cheap. Long term maitenanability,etc, is simply not a business concern.
-cca(不归的如来佛);
2009-10-30{500}(#5645293@0)
JPA (Java Persistence API) is part of EJB 3, while Hibernate is one implementation of JPA. Also, Hibernate can be used without EJB.
-majorhomedepot(马甲后的炮);
2009-10-31(#5648264@0)
you may get performance problem too.
-spruce(toastmaster);
2009-10-31(#5647829@0)
I'm always curious why each time my agent told me my score is very high, and I didn't even get interviews!
-wind_cloud(风逝云栖);
2009-10-30(#5644878@0)
What did you put on your resume? Not just put down your job description, i.e. what did you do. You have to put down your achievement! Job description is feaute and achievement is benefit. What benefits you are going to bring to my company?
-hkchan(0);
2009-10-30(#5644956@0)
Now you know 江湖的险恶。万事讲究一个度,这点老马和老毛都承认。呵呵,量变引起质变吗。
-james05(关不上的窗);
2009-10-30(#5644959@0)