Andres Delrotti

Ranch Hand
+ Follow
since Aug 11, 2005
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 Andres Delrotti

Here is the build.gradle file

Everything is fine but the issue is, inside the generated war file.... under WEB-INF/classes, the compiled classes are missing. The only present items are the properties files from the resources(src/main/resources) package.

Anyone can help us on this? thanks

Project Formats

    >>>>WEB-INF  (placed under XYZApplication) (placed under XYZApplication)

(the parent ear project that contains web nodule XYZApplication)

1 year ago

Tim Holloway wrote:
If you persist or merge data in method A, the changes should appear in the context of method B as long as you are using JPA properly. That is, you retrieve data in method B using the same persistence manager, you retrieve it after it was persisted (don't use out of date objects), and you don't forcibly fetch directly from the database.

I get what you mean but problem is, method B is a web service. Method A is a dao method in the current application.

The option of transferring or copying Method A's logic in Method B is not viable because of that design principle of Cohesion - a web service in our system should have a single, well-focused purpose. Method B is also reused by other systems.

1 year ago

OR you can have method B run as an independent transaction

That's what I initially planned to do. The thing is, if method B fails, I would need to manually revert method A's DB changes. We want to avoid doing a manual revert. Is there an easier way to do this?

If method B is within the same transaction as A, it would not be able to see in the database, method A's changes since it is still uncommitted.
1 year ago
by the way everything is working fine if we temporarily disable the authentication
1 year ago
1. Please see two attached images for the settings we have made to connect our WAS v8.5 to Websphere MQ V9

2. MQ settings are:

- Channel name: CH.QMTEST
- Queue Manager: QM_TEST
- MQ Server host and listener port:
- Queue name: DEV.TESTQ

3. We already set the user authentication: (see image1) but still keep getting the ff. error:

0000005f DefaultMessag E org.springframework.jms.listener.DefaultMessageListenerContainer refreshConnectionUntilSuccessful Could not refresh JMS Connection for destination 'DEV.TESTQ' - retrying using FixedBackOff{interval=5000, currentAttempts=29, maxAttempts=unlimited}. Cause: JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager 'QM_TEST' with connection mode 'Client' and host name ''.; nested exception is JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').

Anyone can help?
1 year ago
Here's a portion of our code:

In the code of UsersWebService:

Since the data insert in TBL_ACCOUNT is not yet committed, insertUserInfo method of UserswebService will always throw an exception, which shouldn't be since technically, there is already inserted data in TBL_ACCOUNT, its just not committed yet.

Is there a way to deal with this scenario ? (besides manual transaction handling)

by the way we are using Spring transaction version 4.2.4.RELEASE

1 year ago

Roel De Nijs wrote:

Andres Delrotti wrote:I hope this would just be simple enough to convert. I'm just new to JPA, specifically JPQL and we wanted to convert this query.

As you are new to JPA, you need a very good resource to refer to if you have doubts, questions and/or looking for some sample code (snippets). The Java Persistence API WikiBook is an excellent resource and when I'm having an issue with JPA, JPQL, or something related it's the first resource I'll check to find a solution. It's really awesome!
I would suggest having a look at several sections of this book: entity mappings, relationships, JPQL query,... and you'll probably discover yourself how this fairly simple query can be converted to JPQL.

Hope it helps!
Kind regards,

Thanks for the info. I was able to find the solution because of it.

Follow up question, is that kind of query advisable to use in JPQL? I read that using WHERE instead of JOIN in JPQL makes the statement more "relational database like" rather than object oriented like whats its suppose to be. Is it more recommended to use join in JPQL when selecting from multiple tables?
This is the query. I hope this would just be simple enough to convert. I'm just new to JPA, specifically JPQL and we wanted to convert this query.

I have started creating the entity objects...

Same for classes TableTwo and TableThree.

I'm confused if you need to use the @OneToMany or @OnetoOne tag to translate that query in JPQL. I guess it won't me that practical to create those tags just for that specific query. This is JPA 2.0 by the way

Any help is appreciated. Thank you.

Bear Bibeault wrote:

If the dropdowns do contain sensitive data that needs protecting, making additional calls makes no sense. Simply return a response status code that indicates a security timeout from the Ajax requests that return the options data.

So you mean, if that happens, the dropdowns should return a single option containing a text like "invalid session" or "no data- session timeout"?

I'm inclined to do your recommendation but wouldn't that confuse the user more? rather than forward him/her to the login page upon onChange of the dropdown?
2 years ago

Stefan Evans wrote:

How do you deal with a session timeout in the general case?
- alert the user, and close the app?
- ask them to log in again (retaining current context or not?)

We are planning this solution. Catch a mouse click anywhere in the page, then check if the clicked element is any of the dropdown, if it is...trigger an ajax call in the back end to check the session. If the session is invalidated, return something like "window.location =" in the page.

Would that work? is that ok?
2 years ago

Bear Bibeault wrote:Don't pass those requests through the filter.

Seems that would cause a hole in the security?
2 years ago

We have a JSP page. In that JSP page there are a lot of dynamic dropdowns. Dynamic meaning when a value is selected in dropdown1, it dictates the values that will be listed in dropdown2 and so on. These are done through Ajax

The problem is when session timeout happens. The ajax calls pass through a controller class back end to query the dropdown values. In our codes there is also a filter class which checks the session before forwarding to call to the chosen controller action. Since the filter class will be able to detect the invalid session, the ajax call would not forward to the controller class its suppose to call. If that happens all dropdowns will show a blank value. This will be confusing to the user.

Is there any way to better handle this?
2 years ago
Alright. I get the message. I will review my other options.
2 years ago
Most of us use Singletons as kind of a memory storage in the JVM. Usual case is the values of a singleton class are set during application startup then accessed later on. At some processes or functions in the application, we update its values.

Ok so if we want to get value someParameter from singleton class SomeSingletonClass, we do this right?

What if this case happens:

Two questions on this:

1. How can I make it return "val2" ? is it even possible to do? I know this case will rarely happen but we want to cover all bases

2. Does this mean we should always use synchronized methods when processing or changing values of singleton classes? shouldn't a synchronized getInstance method be able to handle that? im confused

2 years ago

In our web application, we need to prevent multiple login of the same user. (e.g. User logs in as "user1" in a browser in machine one, does not log out, then later logs in as "user1" in a browser in another machine) In the example mentioned, the logged in session in the first machine should be invalidated. Spring can handle this. The issue is we have an existing application that does not make use of Spring and we wanted to implement the same thing. We need a quick fix for this and we do not have time to implement Spring in the app.

Is there anyway to manually implement this?

2 years ago