[JBoss Portal] - Data access / persistence - could you help?
by JohnnyTheHun
I am setting up a JBoss Portal for evaluation purposes at my company.
I am new to JBoss, Portal, Hibernate and more or less to the J2EE scene too.
I am reading documentation whenever I can, if I run into something and I know where to find the docs.
I have set up the new bundle, wrote a few simple portlets, tested IPC.
I want to do the following - please tell me if I'm on the wrong track:
I am creating two portlets:
SelectDocument portlet show a list of documents the user can select. It gets the list from an underlying database.
ShowDocument portlet listens for selection at SelectDocument and displays the selected document content from the underlying database.
I have got stuck on how to access the underlying database, what API to use, what docs to read. JDBC, Hibernate, EJB3 persistence etc. I need the simplest and minimal resource consuming (there might be a lot of users accessing the page at a time - Connection pooling, caching would be handy) solution.
I will have no problem if someone just gives me a hint at where to start (concerning data access, not j2ee principles) - I tried HibernateUtil.getSession(jndiname), but didn't find the jar that contains HibernateUtil.
Thank you
John
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4107149#4107149
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4107149
18 years, 8 months
[JBoss Seam] - Persistence provider suggestions needed.
by tzman
We have implemented a Custom JPA EntityManager, yes we are either "masochists and/or not very bright". The real reason behind this endeavor is that operations on entities (CRUD) actually occurs via xml messaging with a number of services. So, the EntityManager manages creation of the correct message for the operation called on the given entity. For the most part, implementing the JPA spec made sense. Developers can work with either our EntityManager or the one provided by Hibernate with little transition time. However, there were some things that did not correlate properly to what we needed and we did not want to force something that may end up confusing to developers. Queries were the first thing, and are simply just not supported. Transactions are a little stranger, the concept is somewhat the same but different enough that using the Transaction API would be confusing. So what we have instead is a Bundle, a bundle conceptually works the same as a transaction but differs in that what we are actually doing is sending a number of XML messages "bundled" into a wrapper message. The receiving service will then perform the operations within a single transaction. This all works pretty well, so far.
Now we are to the point of integrating this with Seam. So, we have an EntityManagerFactory, an EntityManager and a Session ( yes, we modeled this after Hibernate; does that make us genius' ). What we do not have is a persistence unit, which does not really map to a host and port number. What we would like to do is have Seam manage the EntityManager/Session and possibly the Bundles.
Our thoughts are that we may have to wrap our Bundle in a transaction implementation for either JPA or Hibernate. But, we are not sure if we can get around not having a persistence unit defined. We are slo unsure if we can try to mirror the Hibernate managed context in Seam or if we need to implement all of the JPA requirements and have Seam manage the JPA persistence provider. What is the easiest and/or best way to do this?
Any suggestions, pointers or comments are appreciated.
Thanks in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4107144#4107144
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4107144
18 years, 8 months