Ally Cavs

Ranch Hand
+ Follow
since Aug 25, 2008
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ally Cavs

java 1.8




I would have assumed this was a common issue but I cnat find anything on the net
Hi Guys

Im doing a LEFT JOIN FETCH in a named query. Result data is as expected. In some cases, parent records wont exist as a foriegn key on the child table. For each parent that doesnt exist on child table JPA does an additional select for this manytoone unidirectional mapping

For parent table where a parent ID does not exist in child row, then JPA does an additional select

How can I stop this additional select. If my search criteria brings back parent rows that all exist as a foreign key on the child table, the additional selects does not happen. If I have 5 parents rows out of result list of 10 that don't exist on child table as a foreign key I will have 5 additional selects.  

Hi Guys

Im using JBoss 6. Ive a ear file which is made up of a:

EJB JAR (Message Driven Beans)
and in lib folder:
a number of custom jars some of which have annotated beans

All the annotated beans can be access for example by

but in my MDB classes if i try

is always null

What can the issue be?
the ejb jar
has ejb-jar.xml
Hi Guys

Im working on a system that has no injections. All classes instantiated using new. We want to change dao layer from jdbc commit/rollback code and use JTA
So I want to inject MyDAOClass classes have

I can only inject MyDaoClass by looking up the context. I want to use @EJB for MyDaoClass injection. Parent class (business layer class) is instantiated with new. i dont want to rewrite everything and have every class injected.Can i use a annotation like @SessionScoped for business class to get JBOSS 6 to inject dao class?

Thanks for reply Tim. So I don't want to introduce spring into the system.

So what options have I. Can I inject into pojos using CDI (beans.XML) or programmatically. I'd love to see a good example of either where the entitymanager can be reused across various dao classes.

Hi Guys

Im working on a java struts project. each struts action instantiates each attribute. No injection happens
So simply each action class instantiates service layer

I want to introduce JPA/JTA and be able to set @Transactional at a service class level (javax.transaction.Transactional) or similar
Can i inject entity manager into POJOs or do something like

Only way I can get a entity manager is by

but every time i do this a new EM is created and therefore a new transaction scope
service class creates a EM and i begin a transaction (RESOURCE_LOCAL)
service class calls Method in DAO class
Dao Class creates a new EM but this is not in same transaction - em.joinTransaction Method does not work

I dont want to pass em round as parameters. If i can acquire em from InitialContext then i believe ill be using same em at service and dao layers

Can i inject EM into pojos using CDI? any concrete example of this as I cant find one or anyone have a solution I could use. Ive tried javax.transaction.UserTransaction but this gave sporadic tranaction issues

hey Guys

I have attempted to use both apache server and ha proxy to load balance an web application on 2 glassfish domains -domain 2 - domain 2

But no matter what configuration I use my browser gets Error code: ERR_TOO_MANY_REDIRECTS
Seems Spring security uses relative URls vs absolute URLs so I think this is the problem.
has anyone seen this issue before?

Ive read various websites about load balancing and spring security. It seems to be a known issue with no real fix?

To me there should be just so some config that i can add to load balancer to get this to work

6 years ago
Hi Guys

I have a application made up of Spring/JPA/Hibernate. The JPA layer does the transaction handling. The application uses Glassfish jdbc connection pools.
In the logs there is an alarming amount of database calls setting autocommit to on then off. I believe this to be an issue between GF and mysql. Any pointers? Even if itcould be a problem with the applicatio any pointers for what to check for?

Im thinking should all webservice calls be annotated with @Transactional?

Even for selects the logs would show

the applicaton is clustered across a few instances of GF with 1 write database and a 5 readonly databases. If i can at least stop the autcommit changes on the readonly databases that would be a step forward. Im looking for pointers of what i could look into here as Im a bit confused
These setting on and off is takiing up alot of time on the database so if i can set readonly databases to default autocommit off (or on if needs be) databasse performance should improve

7 years ago
The exceltion is as follows:

Id just like teh HQL version of the SQL thats all.

Hey Guys

i have tried numerous attempts at rewriting this SQL in HQL. Im new enough so if someone coiuld rewrite query SQL to HQL Id be delighted.
reportID is primary key. userID is foreign key and repeated in report table.

MY HQL attempt

yet I get bad Invalid HQL query
Hi Guys

I will be receiving a Long from client side which is a representation of the time. I would like to be able to annotate the Long so the value can be persisted to a Timestamp DB field.
I could adjust setter and getter code to set a second java Timestamp field with a similar name and annotate the class accordingly but ill have to do this for every long (time) attribute

Any help would be much appreciated? There must be a a kind of Long to Timestamp mapper facility?

Hi Guys,

I have a custom control called AutoCompleteComboBox which extends ComboBox. If I have a tableview how can i get this AutoCompleteComboBox to display in a cell when clicked?

7 years ago
Hi Guys

I have my javafx app running but i want to build a JNLP. Im using Java 7. I included the below snippet in my pom.xml to specify javafx dependency but i still get when i run the jnlp

where the variables are declared as properties

Please help?

7 years ago
Any help here guys? is my question clear? i was hoping for a reply :-(