Win a copy of Kotlin Cookbook this week in the Kotlin forum!

abhinas raj

Ranch Hand
+ Follow
since Jun 02, 2012
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
4
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by abhinas raj

Tim Cooke wrote:I'm pretty sure you can't pass variables into Java Annotations, so no that won't help.



Thank you Tim for your reply
3 years ago

Tim Cooke wrote:If you have named your bean definitions then you could use

For example (pseudo-code)



will @Autowire with @Qualifier(vehicleName)  can help here ? we can get vehicleName from user and pass inside @Qualifier.
3 years ago

Tim Cooke wrote:

abhinas raj wrote:i need to do it using features of spring  only



Why?



Actually i was asked this question in an interview. he was asking like there is some way to do that in spring because he told that you do not have to do it with factory design pattern.
3 years ago

Tim Cooke wrote:Autowired isn't the right solution for this use case. In fact, your example given will fail to start as Spring will complain that it doesn't know which implementation of Vehicle it should inject.

You will need to write some code that will recognise the user input and create the correct implementation of Vehicle. The Factory Pattern might be a suitable approach to take here.



yes right now it will fail. but if i have configured all the beans in spring config file spring container has to create the instances of the  beans. if i use factory pattern to create the objects based on the data passed from
ui then i think there is no use of using spring for this use case. i need to do it using features of spring  only. that's why i had to ask if there is any way in spring to achieve this use case.
3 years ago
3 years ago
Hi all,

In my project i am using Apache Tomcat and FTP server. files are manually put in a folder (say A )at FTP server from this folder files taken and put into another folder(say B) after processing [code to create these folders
is inside Tomcat ] . FTP server gives those files [from folder B] to Tomcat for processing. so folders A and B has to be created on the server on which FTP is running. but if we put Tomcat and FTP on same sever then
folders A and B will be created 2 times [once by code running at Tomcat and second time by FTP server] is it true ? so do we need to keep Tomcat and FTP always on different server.

3 years ago

K. Tsang wrote:try following this

Make sure you know where the mysql logs are and where the config file my.cfg is located

Googling the error will give you other sources for solving your problem.



Thank you for you reply.
My problem is solved now. it was was happening because i aborted the exporting mysql dump file.
i had to run command to reinstall the Mysql.

Ron McLeod wrote:

abhinas raj wrote:how we set barrier=0 in centos through commond line and how to set it permanently ?


You can use tune2fs to permanently set barrier. You can also specify it as a mount option in /etc/fstab.


abhinas raj wrote:how i can check value of barrier in centos ?


/proc/mounts will show you the current setting




I run the command and following is the result

----------------------------------------------------------------------------------------------------------------------------------------------------
[root@sip_61 ~]# cat /proc/mounts
rootfs / rootfs rw 0 0
/proc /proc proc rw,relatime 0 0
/sys /sys sysfs rw,relatime 0 0
udev /dev devtmpfs rw,relatime,size=7979964k,nr_inodes=156077,mode=755 0 0
devpts /dev/pts devpts rw,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /dev/shm tmpfs rw,relatime 0 0
/dev/mapper/VolGroup00-LogVol00 / ext3 rw,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered 0 0
/proc/bus/usb /proc/bus/usb usbfs rw,relatime 0 0
/dev/sda1 /boot ext4 rw,relatime,barrier=1,data=ordered 0 0
/dev/mapper/VolGroup00-LogVol02 /opt ext3 rw,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered 0 0
/dev/mapper/VolGroup00-LogVol03 /var ext3 rw,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0
/etc/auto.misc /misc autofs rw,relatime,fd=7,pgrp=2128,timeout=300,minproto=5,maxproto=5,indirect 0 0
-hosts /net autofs rw,relatime,fd=13,pgrp=2128,timeout=300,minproto=5,maxproto=5,indirect 0 0
nfsd /proc/fs/nfsd nfsd rw,relatime 0 0
----------------------------------------------------------------------------------------------------------------------------------------------------

but i am not able to use tune2fs to set,
barrier = 0 and data=writeback
what adjectly is the syntax to use this command ? kindly reply soon its urgent for me. i wasted too much time and effort in all the above things.
3 years ago

Tim Holloway wrote:What is "barrier"? What subsystem or application does it apply to?



you can get some idea from bellow link.i am facing same problem. but i dont know what adjectly is the syntax of command to set/_mount the barriers and data


http://serverfault.com/questions/486677/should-we-mount-with-data-writeback-and-barrier-0-on-ext3
3 years ago
Hi all,

i am new to CentOS. i searched a lot in google but could not find it.
i need to know

1) how we set barrier=0 in centos through commond line and how to set it permanently ? do i need to restart the server to see the change
2) how i can check value of barrier in centos ?
3 years ago
Hi all,

i am always getting an error saying "Starting MySQL. ERROR! Manager of pid-file quit without updating file."

what i did was. without stopping the MySql i delete the files from mysql folder and reinstalled MariaDB .

after that whenever i do service start mysql i get the above error. i searched a lot in google whatever they are telling is not working for me.

can anyone list all the reason for getting the above error.

Dave Tolls wrote:Have you got the code working that was in that other thread, as it still looks like it wasn't working.



it was working. both working and not working code are there in the thread. working code i am pasting here again

Knute Snortum wrote:My guess is that it does the 10 inserts atomically.



i do not think so, as i am inserting each record individually.

Knute Snortum wrote:I'm not sure what you mean by "what it does internally". BEGIN/END is a syntax to create a compound statement. It doesn't "do" anything.




when is used "BEGIN" in my code then it made insertion 10 times faster. you can see the post in detail here

https://coderanch.com/t/664616/JDBC/databases/insert-statement-slow-maria-db