Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

benjamin muktesh

Greenhorn
+ Follow
since Jul 01, 2008
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 benjamin muktesh

Mark E Hansen wrote:

benjamin muktesh wrote:You can also do the following:

@Column(columnDefinition = "VARCHAR(12) DEFAULT 'NEW'", name = "status", nullable = false)


In that case, aren't you configuring the default on the database column, not on the class itself. This assumes the database supports a default, right? Also the value wouldn't be assigned until after the new record was saved in the database.



Yes sir it will be applied on the table and the DDL would look something like this

You can also do the following:

@Column(columnDefinition = "VARCHAR(12) DEFAULT 'NEW'", name = "status", nullable = false)
Never mind.
I switched to Atomikos and it worked like a dream.
I am trying to wrap transactions spanning multiple databases in a JtaTransactionManager.
I am using JOTM to get instance of a userTransaction



my understanding here is that i dont need to make my sessionFactory aware of what transaction management strategy i am using.
Also if i need to make piece of code atomic i just mark the method as @Transactional.

Somehow this approach fails miserably and my transactions are not being rolled back.
Any insight or help is greatly welcome

Thanks
Thanks for your reply. ill try to work it out.

I found the reason why reset is not working in my case.

If we have a small file then FormFile object is read into a byte array hence we can reset it. But in case of a large file, FormFile object returns a File object which throws an IO exception if we try to reset it. Its pretty well documented in the API , I just overlooked it.

Guess i have to look at implementing it differently.
13 years ago
I am trying to get the input stream from a zip file uploaded through struts form file, like so:


I am then passing it to my delegate for some processing. The delegate method in turn passes the input stream to two methods like so:



Here is where i run into trouble, reset is not support , i have checked in.markSupported() and it returns false.

is there a way i can reuse the input stream?

I know this(resetting) works for text/csv files but not so(apparently) for zip files.

any pointers would be welcome. Also if anyone can tell me what is the different between inputstream coming from a text/csv and a zip file

Thanks
13 years ago
If you just want to import data from a database into excel you don't need JDBC to do that. A bit of SQL and Excel knowledge should take you through.
Excel has an inbuilt query wizard which allows you to connect to a database and execute queries.
I will start you off in the right direction:

Open an excel sheet
Click on data->Import External Data->New database query
This will open data source selector
While on database tab select <New data source> and hit ok
Now you can select whatever is applicable in your case and start writing queries.
A good place to start would be to check in your browser settings if you have enabled ssl usage.
In IE go to internet options -> Advanced
In firefox, options -> advanced
13 years ago
Oracle apps run as a windows services, you can try to disable the services and see.it should work.
13 years ago
In the tomcat bin directory open Catalina.sh

And add an entry for
JAVA_OPTS Java runtime options used when the "start", "stop", or "run" command is executed.

Set the param to (modify as per your requirement)
export CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=9002 \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false \
-Djava.rmi.server.hostname=10.2.106.100 \
-Xms12m -Xmx64m -XX:MaxPermSize=32m"

Here 9002 is the jmx port
Hostname is the ip of the tomcat server

The last line is where you set the jvm heap size
-Xms = initial
-Xmx = Maximum

Now go to you jdk/bin directory and open up a jconsole

Select the remote tab and provide the settings
Ip and port number , which in our case are 10.2.106.100 and 9002 respectively.

You are all set.
[ August 15, 2008: Message edited by: benjamin muktesh ]
13 years ago
Eclipse is an IDE not an EJB container.
You can write EJB's on Eclipse but to run them you will need Websphere or JBoss.
[ August 15, 2008: Message edited by: benjamin muktesh ]
13 years ago