Maneeesh Saxena

Greenhorn
+ Follow
since Dec 24, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Maneeesh Saxena

Thanks Mr. Mark. I got it. Thanks for such a nice explanation.

Best Regards,
Maneesh Saxena
11 years ago
Any One .. Any Help !!!
11 years ago
complete log in case it's needed.

11 years ago

hi Great Ranchers,


Please refer the below code.






In class shown above insertUser() makes a call to deleteUser(). As per my understanding deleteUser() should have been executed in a new/saparate transaction, as it's annotated as @Transactional(propagation = Propagation.REQUIRES_NEW), but it's not happening that way. Instead deleteUser() is also executing in same transaction as that of insertUser(). Below is the log for this code which shows the same.



If that's correct than what is the use of @Transactional(propagation = Propagation.REQUIRES_NEW) annotation at deleteUser().

How a method will execute in saparate transaction if it's marked with an annotation @Transactional(propagation = Propagation.REQUIRES_NEW).

I am confused, please help me. Please let me know if question is not clear.


Best Regards,
Maneesh Saxena
11 years ago
hi Great Ranchers,


Is there any good link where I can have good understanding of Spring transaction as in my new project I would be majorly working on Spring Transaction.

Thanks & Best Regards,
Maneesh Saxena
11 years ago
hi Mark,

Thanks for your reply. Still I've some doubts, please refer the code below which is related to it.


web.xml




testContentNegotiation-servlet.xml



FruitController.jsva





list.jsp




Fruit.java






Everything is fine for above code. I got json view as well as xml view for Fruit resource. But as shown I didn't configure any HttpMessageConverter in my context file. If HttpMessageConverter and ContentNegotiatingViewResolver works together then how conversion is performed here ?


I've a separate class shown below.

CoffeeController.java




Coffee.java




I got only xml representation for both Urls http://localhost:8080/contextName/testContentNegotiation/coffee/mocha (.xml or .json ). I am not getting any idea how this is happening as I didn't configure any MessageConverter in context. if that's mandatory then why xml is returned for both Urls. What role @ResponseBody is playing in CoffeeController.getCoffeeInXML() method?



One more doubt what is role of defaultViews and viewResolvers properties of ContentNegotiatingViewResolver.


Thanks and Regards,
Maneesh
11 years ago
I would be grateful if someone can describe with examples.

Thanks & Regards,
Maneesh Saxena
11 years ago
hi All,

I am confused about HttpMessageConverter and ContentNegotiatingViewResolver. Both does the same work or they are different? if we've an object that we wanna represent in xml format we can do it by using ContentNegotiatingViewResolver, same thing can be done using HttpMessageConverter. Then what is the difference?


I am really confused. Please let me know if my question is not correct.
11 years ago
Guys!!! Any clues .. ??
11 years ago
hi All,


Is there any book, tutorial which describes SAML and OAuth suppot in Spring3.0 with example. If you know please share the link ASAP. I got some tutorials for OAuth but that are more specific to Facebook & Twitter. If there's some link which explains these concepts in more generic way then please share that link.

Thanks in advance..

Best Regards,
Maneesh Saxena
11 years ago
Dear Ranchers,

I came across a confusion while reading instanceof operator. As per my understanding below code must have thrown a compile time error as Map & Collection are not in same class hierarchy. But code compiles fine please go through the code & let me know why is it happening ?





Thanks & Regards
hi Great Ranchers,

I was wondering if someone has Danchisholm exams in pdf/doc format.

Best Regards
Maneesh Saxena
Hi All,

Now I am able to upload file in database now the problem is I've to download the file. I've googled a lot but could not find any web app for doing the same please help me in this ...


Best Regards
Maneesh Saxena
13 years ago
Hi Great Ranchers,

I am facing problem while saving Blob object (which represents a file being uploaded). When I run this code I don't get my object saved. Please suggest where I am missing something to get code working properly.



Employee.java

public class Employee implements Serializable {
long id;
private String name;
private String department;
private String projectTitle;
private String projectDescription;
private Blob content;
...................................


Employee.hbm.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
<class name="com.test.beans.Employee" table="Employee">
<id name="id" type="long" column="ID">
<generator class="assigned" />
</id>

<property name="content" type="blob">
<column name="CONTENT" />
</property>
...................................


MyDaoImpl.java

Blob blob = null;
InputStream in = file.getInputStream(); //File being uploaded
blob = Hibernate.createBlob(in);
employee.setContent(blob);
hibernateTemplate.saveOrUpdate(employee);
.......................................................


Thanks & Best Regards
Maneesh Saxena
13 years ago
Thanks for your kind reply. Actually I've never used this API ... Was wondering if you can indicate me which class I should use to get my work done ...

Best Regards
13 years ago