-
1. Re: how to modify a file in my jar(VFS)
sfcoy Oct 10, 2012 7:12 PM (in response to sh1theng)What exactly are you trying to do?
Perhaps there is a better way...
-
2. Re: how to modify a file in my jar(VFS)
sh1theng Oct 11, 2012 2:55 AM (in response to sfcoy)I want to use a seq file to replace an oracle sequence.
I place the file in my EJB project,read it and increase it.
-
3. Re: how to modify a file in my jar(VFS)
nickarls Oct 11, 2012 3:02 AM (in response to sh1theng)Can't you just stick the value in a property file in the deployment?
-
4. Re: how to modify a file in my jar(VFS)
sh1theng Oct 11, 2012 3:18 AM (in response to nickarls)what is property file?
oracle sequence.nextval only can get the one value,I want get more,sometimes 10,sometimes 100
So I use a file to record the value,I get 10,I icrease 10,
If i can not icrease the value ,I would get a repeat value when I restart the Jboss.
For convenience,I put it in my EJB project,when I move the server,I just need to move the jar.
-
5. Re: how to modify a file in my jar(VFS)
nickarls Oct 11, 2012 3:22 AM (in response to sh1theng)Umm. Why don't you just bypass the sequence altogether (since you're not really using it as a sequence)?. Store the last used value in a table row and use some "for update" to handle concurrency. Reading and writing a physcial file doesn't feel that robust.
-
6. Re: how to modify a file in my jar(VFS)
sh1theng Oct 11, 2012 3:33 AM (in response to nickarls)that is the way i am using now.
select .... for update and then update it.
but sometimes it stuck.Looks like a deadlock,after 5000ms jboss throw a timeout Exception.
Maybe there some conflict with lock escalation
-
7. Re: how to modify a file in my jar(VFS)
nickarls Oct 11, 2012 3:39 AM (in response to sh1theng)Show the entire stack trace if available. In any case, I would say that is the path to follow instead of fiddling with files.
-
8. Re: how to modify a file in my jar(VFS)
sh1theng Oct 11, 2012 3:58 AM (in response to nickarls)I try to use synchronized,and it didnot happen since now.